add --declaredlocs (#15666)
This commit is contained in:
parent
4b0b3818c3
commit
05752cd5d0
7 changed files with 21 additions and 11 deletions
|
|
@ -208,6 +208,7 @@ proc presentFailedCandidates(c: PContext, n: PNode, errors: CandidateErrors):
|
|||
{renderNoBody, renderNoComments, renderNoPragmas}))
|
||||
else:
|
||||
candidates.add(getProcHeader(c.config, err.sym, prefer))
|
||||
candidates.addDeclaredLocMaybe(c.config, err.sym)
|
||||
candidates.add("\n")
|
||||
let nArg = if err.firstMismatch.arg < n.len: n[err.firstMismatch.arg] else: nil
|
||||
let nameParam = if err.firstMismatch.formal != nil: err.firstMismatch.formal.name.s else: ""
|
||||
|
|
@ -230,9 +231,8 @@ proc presentFailedCandidates(c: PContext, n: PNode, errors: CandidateErrors):
|
|||
doAssert err.firstMismatch.formal != nil
|
||||
candidates.add("\n required type for " & nameParam & ": ")
|
||||
candidates.add typeToString(wanted)
|
||||
when false:
|
||||
if wanted.sym != nil:
|
||||
candidates.add "(" & (c.config $ wanted.sym.info) & ")"
|
||||
if wanted.sym != nil:
|
||||
candidates.addDeclaredLocMaybe(c.config, wanted.sym)
|
||||
candidates.add "\n but expression '"
|
||||
if err.firstMismatch.kind == kVarNeeded:
|
||||
candidates.add renderNotLValue(nArg)
|
||||
|
|
@ -242,9 +242,8 @@ proc presentFailedCandidates(c: PContext, n: PNode, errors: CandidateErrors):
|
|||
candidates.add "' is of type: "
|
||||
var got = nArg.typ
|
||||
candidates.add typeToString(got)
|
||||
when false:
|
||||
if got.sym != nil:
|
||||
candidates.add "(" & (c.config $ got.sym.info) & ")"
|
||||
if got.sym != nil:
|
||||
candidates.addDeclaredLocMaybe(c.config, got.sym)
|
||||
|
||||
doAssert wanted != nil
|
||||
if got != nil: effectProblem(wanted, got, candidates, c)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue