use typeof instead type (#16962)

This commit is contained in:
flywind 2021-02-08 02:46:07 -06:00 • committed by GitHub
commit d447c0fe3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 253 additions and 253 deletions

View file

@ -1346,7 +1346,7 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode,
r = skipIntLit(r, c.idgen)
if kind == skIterator:
# see tchainediterators
# in cases like iterator foo(it: iterator): type(it)
# in cases like iterator foo(it: iterator): typeof(it)
# we don't need to change the return type to iter[T]
result.flags.incl tfIterator
# XXX Would be nice if we could get rid of this
@ -1704,7 +1704,7 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType =
case n.kind
of nkEmpty: result = n.typ
of nkTypeOfExpr:
# for ``type(countup(1,3))``, see ``tests/ttoseq``.
# for ``typeof(countup(1,3))``, see ``tests/ttoseq``.
checkSonsLen(n, 1, c.config)
result = semTypeof(c, n[0], prev)
if result.kind == tyTypeDesc: result.flags.incl tfExplicit