summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-05-31 14:34:46 +0200
committerAraq <rumpf_a@web.de>2017-05-31 14:34:46 +0200
commit68d606d77388669c791a2f26bc1b33c596e92cf0 (patch)
tree5ea8d4f534b83e684a688633df62e20d48a8dbab
parenteb83ec2685f5bbd0d65051b1f00502f05a367172 (diff)
downloadNim-68d606d77388669c791a2f26bc1b33c596e92cf0.tar.gz
improve confusing error messages for failed overloading resolution when deref of first arg failed
-rw-r--r--compiler/semcall.nim8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/semcall.nim b/compiler/semcall.nim
index 4fa4f7f32..881532d57 100644
--- a/compiler/semcall.nim
+++ b/compiler/semcall.nim
@@ -408,7 +408,13 @@ proc semOverloadedCall(c: PContext, n, nOrig: PNode,
     else:
       # get rid of the deref again for a better error message:
       n.sons[1] = n.sons[1].sons[0]
-      notFoundError(c, n, errors)
+      #notFoundError(c, n, errors)
+      if efExplain notin flags:
+        # repeat the overload resolution,
+        # this time enabling all the diagnostic output (this should fail again)
+        discard semOverloadedCall(c, n, nOrig, filter, flags + {efExplain})
+      else:
+        notFoundError(c, n, errors)
   else:
     if efExplain notin flags:
       # repeat the overload resolution,