honor --declaredLocs in more places, including type mismatch errors; also show kind with --declaredLocs (#15673)
* honor --declaredLocs in more places, including type mismatch errors * fix tests * show declaration location also when type mismatch names clash
This commit is contained in:
parent
218acfe367
commit
0fb878324e
7 changed files with 40 additions and 24 deletions
|
|
@ -154,12 +154,14 @@ type
|
|||
scope*: PScope
|
||||
inSymChoice: IntSet
|
||||
|
||||
proc getSymRepr*(conf: ConfigRef; s: PSym): string =
|
||||
proc getSymRepr*(conf: ConfigRef; s: PSym, getDeclarationPath = true): string =
|
||||
case s.kind
|
||||
of routineKinds, skType:
|
||||
result = getProcHeader(conf, s)
|
||||
result = getProcHeader(conf, s, getDeclarationPath = getDeclarationPath)
|
||||
else:
|
||||
result = s.name.s
|
||||
result = "'$1'" % s.name.s
|
||||
if getDeclarationPath:
|
||||
result.addDeclaredLoc(conf, s)
|
||||
|
||||
proc ensureNoMissingOrUnusedSymbols(c: PContext; scope: PScope) =
|
||||
# check if all symbols have been used and defined:
|
||||
|
|
@ -172,7 +174,7 @@ proc ensureNoMissingOrUnusedSymbols(c: PContext; scope: PScope) =
|
|||
# and slow 'suggest' down:
|
||||
if missingImpls == 0:
|
||||
localError(c.config, s.info, "implementation of '$1' expected" %
|
||||
getSymRepr(c.config, s))
|
||||
getSymRepr(c.config, s, getDeclarationPath=false))
|
||||
inc missingImpls
|
||||
elif {sfUsed, sfExported} * s.flags == {}:
|
||||
if s.kind notin {skForVar, skParam, skMethod, skUnknown, skGenericParam, skEnumField}:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue