--declaredlocs now shows location for T instead of static in proc fn(a: static T) (#17795)

This commit is contained in:
Timothee Cour 2021-04-23 14:22:04 -07:00 • committed by GitHub
commit 80df21d9a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -131,7 +131,10 @@ proc addDeclaredLocMaybe*(result: var string, conf: ConfigRef; sym: PSym) =
addDeclaredLoc(result, conf, sym)
proc addDeclaredLoc*(result: var string, conf: ConfigRef; typ: PType) =
let typ = typ.skipTypes(abstractInst - {tyRange})
# xxx figure out how to resolve `tyGenericParam`, e.g. for
# proc fn[T](a: T, b: T) = discard
# fn(1.1, "a")
let typ = typ.skipTypes(abstractInst + {tyStatic} - {tyRange})
result.add " [$1" % typ.kind.toHumanStr
if typ.sym != nil:
result.add " declared in " & toFileLineCol(conf, typ.sym.info)