summary refs log tree commit diff stats
path: root/compiler/sigmatch.nim
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2013-03-01 12:12:53 +0200
committerZahary Karadjov <zahary@gmail.com>2013-03-01 12:12:53 +0200
commit0774af169b44e5e2a67a880e694f2140b3c694da (patch)
treec156369b9ad9b254d44269b4c522d0ea6826c45b /compiler/sigmatch.nim
parenta668b4ffb57d23e4a1276a5436a600653f7755fb (diff)
downloadNim-0774af169b44e5e2a67a880e694f2140b3c694da.tar.gz
containerID is no longer needed for generics
Diffstat (limited to 'compiler/sigmatch.nim')
-rwxr-xr-xcompiler/sigmatch.nim9
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index 953dcfa74..72a5762a9 100755
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -493,11 +493,10 @@ proc typeRel(c: var TCandidate, f, a: PType): TTypeRelation =
       # simply no match for now:
       nil
     elif x.kind == tyGenericInst and 
-          (f.sons[0].containerID == x.sons[0].containerID) and
-          (sonsLen(x) - 1 == sonsLen(f)): 
-      assert(x.sons[0].kind == tyGenericBody)
-      for i in countup(1, sonsLen(f) - 1): 
-        if x.sons[i].kind == tyGenericParam: 
+          (f.sons[0] == x.sons[0]) and
+          (sonsLen(x) - 1 == sonsLen(f)):
+      for i in countup(1, sonsLen(f) - 1):
+        if x.sons[i].kind == tyGenericParam:
           InternalError("wrong instantiated type!")
         elif typeRel(c, f.sons[i], x.sons[i]) <= isSubtype: return 
       result = isGeneric