summary refs log tree commit diff stats
path: root/compiler/sigmatch.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/sigmatch.nim')
-rw-r--r--compiler/sigmatch.nim21
1 files changed, 6 insertions, 15 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index f1fd84326..e56d82a5b 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -191,21 +191,6 @@ proc complexDisambiguation(a, b: PType): int =
     for i in 1 .. <a.len: x += a.sons[i].sumGeneric
     for i in 1 .. <b.len: y += b.sons[i].sumGeneric
     result = x - y
-  when false:
-    proc betterThan(a, b: PType): bool {.inline.} = a.sumGeneric > b.sumGeneric
-
-    if a.len > 1 and b.len > 1:
-      let aa = a.sons[1].sumGeneric
-      let bb = b.sons[1].sumGeneric
-      var a = a
-      var b = b
-
-      if aa < bb: swap(a, b)
-      # all must be better
-      for i in 2 .. <min(a.len, b.len):
-        if not a.sons[i].betterThan(b.sons[i]): return 0
-      # a must be longer or of the same length as b:
-      result = a.len - b.len
 
 proc cmpCandidates*(a, b: TCandidate): int =
   result = a.exactMatches - b.exactMatches
@@ -1463,6 +1448,12 @@ proc matchesAux(c: PContext, n, nOrig: PNode,
       else:
         m.state = csNoMatch
         return
+    if formal.typ.kind == tyVar:
+      if n.isLValue:
+        inc(m.genericMatches, 100)
+      else:
+        m.state = csNoMatch
+        return
 
   var
     # iterates over formal parameters