summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2014-10-02 00:38:27 +0200
committerAndreas Rumpf <rumpf_a@web.de>2014-10-02 00:38:27 +0200
commit2154906fc9b02aa660caec738ebc11529e89bfad (patch)
tree9bc60a0e65cc9924267fd5168f58df447e5b3250
parent93d55c077ffc9b9df381b4f921a16960c7141f19 (diff)
parent55c78af9c0a7a63683ee49044ece0667f699adc8 (diff)
downloadNim-2154906fc9b02aa660caec738ebc11529e89bfad.tar.gz
Merge pull request #1549 from Varriount/fix-1529
Fixes #1529
-rw-r--r--compiler/procfind.nim11
1 files changed, 9 insertions, 2 deletions
diff --git a/compiler/procfind.nim b/compiler/procfind.nim
index 0354d585d..9f52cc117 100644
--- a/compiler/procfind.nim
+++ b/compiler/procfind.nim
@@ -70,8 +70,15 @@ proc searchForProcNew(c: PContext, scope: PScope, fn: PSym): PSym =
   var it: TIdentIter
   result = initIdentIter(it, scope.symbols, fn.name)
   while result != nil:
-    if result.kind in skProcKinds and
-       sameType(result.typ, fn.typ, flags): return
+    if result.kind in skProcKinds and sameType(result.typ, fn.typ, flags):
+      case equalParams(result.typ.n, fn.typ.n)
+      of paramsEqual:
+        return
+      of paramsIncompatible:
+        localError(fn.info, errNotOverloadable, fn.name.s)
+        return
+      of paramsNotEqual:
+        discard
 
     result = nextIdentIter(it, scope.symbols)