This commit is contained in:
Araq 2018-03-18 12:13:55 +01:00
commit 863c626078

View file

@ -190,12 +190,12 @@ proc presentFailedCandidates(c: PContext, n: PNode, errors: CandidateErrors):
if wanted != nil and got != nil: if wanted != nil and got != nil:
effectProblem(wanted, got, candidates) effectProblem(wanted, got, candidates)
if cond: candidates.add "\n" if cond: candidates.add "\n"
elif err.unmatchedVarParam != 0 and err.unmatchedVarParam < n.len: if err.unmatchedVarParam != 0 and err.unmatchedVarParam < n.len:
add(candidates, "for a 'var' type a variable needs to be passed, but '" & candidates.add(" for a 'var' type a variable needs to be passed, but '" &
renderNotLValue(n[err.unmatchedVarParam]) & renderNotLValue(n[err.unmatchedVarParam]) &
"' is immutable\n") "' is immutable\n")
for diag in err.diagnostics: for diag in err.diagnostics:
add(candidates, diag & "\n") candidates.add(diag & "\n")
result = (prefer, candidates) result = (prefer, candidates)