getType now works with tyInferred (arising from concepts); refs #18220 (#18241)

* getType now works with tyInferred (concepts); refs #18220

* avoid cast

* add more docs
This commit is contained in:
Timothee Cour 2021-06-12 12:35:12 -07:00 • committed by GitHub
commit 897e50d5fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 79 additions and 23 deletions

View file

@ -289,7 +289,7 @@ proc mapTypeToAstX(cache: IdentCache; t: PType; info: TLineInfo;
of tyNot: result = mapTypeToBracket("not", mNot, t, info)
of tyIterable: result = mapTypeToBracket("iterable", mIterableType, t, info)
of tyAnything: result = atomicType("anything", mNone)
of tyInferred: assert false
of tyInferred: result = mapTypeToAstX(cache, t.lastSon, info, idgen, inst, allowRecursion)
of tyStatic, tyFromExpr:
if inst:
if t.n != nil: result = t.n.copyTree