summary refs log tree commit diff stats
path: root/compiler/sigmatch.nim
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2014-01-04 12:28:25 +0200
committerZahary Karadjov <zahary@gmail.com>2014-01-04 13:10:52 +0200
commit789ba107cf3bcc1a87d896fc7cbfa11e151898c2 (patch)
treea912096f7e5133f3dd08528d1499d6cd1ecec305 /compiler/sigmatch.nim
parent02533c260b16ce7b16a47781d104b46b36544749 (diff)
downloadNim-789ba107cf3bcc1a87d896fc7cbfa11e151898c2.tar.gz
introduce tyFromExpr; fixes #618
Diffstat (limited to 'compiler/sigmatch.nim')
-rw-r--r--compiler/sigmatch.nim10
1 files changed, 7 insertions, 3 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index 2e314d115..43f1cded9 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -665,10 +665,14 @@ proc typeRel(c: var TCandidate, f, aOrig: PType, doBind = true): TTypeRelation =
   of tyGenericInst:
     let roota = a.skipGenericAlias
     let rootf = f.skipGenericAlias
-    if a.kind == tyGenericInst and roota.base == rootf.base:
+    if a.kind == tyGenericInst and roota.base == rootf.base :
       for i in 1 .. rootf.sonsLen-2:
-        result = typeRel(c, rootf.sons[i], roota.sons[i])
-        if result == isNone: return
+        let ff = rootf.sons[i]
+        let aa = roota.sons[i]
+        result = typeRel(c, ff, aa)
+        if result == isNone: return        
+        if ff.kind == tyRange and result != isEqual: return isNone
+
       result = isGeneric
     else:
       result = typeRel(c, lastSon(f), a)