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:
parent
5a42f4a53e
commit
836b061ae3
8 changed files with 112 additions and 14 deletions
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue