improve --declaredLocs to help disambiguate types (generics, aliases etc) (#18389)

* improve --declaredlocs to help disambiguate types (generics, aliases etc)

* avoid a cyclic deps

* fix test after rebase
This commit is contained in:
Timothee Cour 2021-07-08 03:28:06 -07:00 • committed by GitHub
commit 836b061ae3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 112 additions and 14 deletions

View file

@ -50,6 +50,14 @@ type
pcmDifferentCallConv
proc typeToString*(typ: PType; prefer: TPreferedDesc = preferName): string
proc addTypeDeclVerboseMaybe*(result: var string, conf: ConfigRef; typ: PType) =
if optDeclaredLocs in conf.globalOptions:
result.add typeToString(typ, preferMixed)
result.addDeclaredLoc(conf, typ)
else:
result.add typeToString(typ)
template `$`*(typ: PType): string = typeToString(typ)
proc base*(t: PType): PType =