summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorClay Sweetser <clay.sweetser@gmail.com>2014-10-01 18:14:06 -0400
committerClay Sweetser <clay.sweetser@gmail.com>2014-10-01 18:14:06 -0400
commit55c78af9c0a7a63683ee49044ece0667f699adc8 (patch)
tree9bc60a0e65cc9924267fd5168f58df447e5b3250 /compiler
parent93d55c077ffc9b9df381b4f921a16960c7141f19 (diff)
downloadNim-55c78af9c0a7a63683ee49044ece0667f699adc8.tar.gz
Fixes #1529
Diffstat (limited to 'compiler')
-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)