summary refs log tree commit diff stats
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
parent93d55c077ffc9b9df381b4f921a16960c7141f19 (diff)
downloadNim-55c78af9c0a7a63683ee49044ece0667f699adc8.tar.gz
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)
   
'n138' href='#n138'>138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220