summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-03-18 12:13:55 +0100
committerAraq <rumpf_a@web.de>2018-03-18 12:13:55 +0100
commit863c6260788f8ba1102845c338dc8f0ff283e3a0 (patch)
treec787edcbdd31387d41519376c23e5fd07275a9ea
parentb0994c7f929395217b3caeb2699add29f35ff61e (diff)
downloadNim-863c6260788f8ba1102845c338dc8f0ff283e3a0.tar.gz
fixes #7335
-rw-r--r--compiler/semcall.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/semcall.nim b/compiler/semcall.nim
index ba38ed215..0fc12f164 100644
--- a/compiler/semcall.nim
+++ b/compiler/semcall.nim
@@ -190,12 +190,12 @@ proc presentFailedCandidates(c: PContext, n: PNode, errors: CandidateErrors):
       if wanted != nil and got != nil:
         effectProblem(wanted, got, candidates)
       if cond: candidates.add "\n"
-    elif err.unmatchedVarParam != 0 and err.unmatchedVarParam < n.len:
-      add(candidates, "for a 'var' type a variable needs to be passed, but '" &
+    if err.unmatchedVarParam != 0 and err.unmatchedVarParam < n.len:
+      candidates.add("  for a 'var' type a variable needs to be passed, but '" &
                       renderNotLValue(n[err.unmatchedVarParam]) &
                       "' is immutable\n")
     for diag in err.diagnostics:
-      add(candidates, diag & "\n")
+      candidates.add(diag & "\n")
 
   result = (prefer, candidates)