summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-07-29 01:56:32 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-07-29 01:56:32 +0200
commit953a5eb64438fb695424e71fde0f914ecf856372 (patch)
tree5ae607af6f0da1d930575d1d5020b90fc7f5e880 /compiler
parent9fbd9e902882bdc90d4b82561e1c831a0ceb67d2 (diff)
downloadNim-953a5eb64438fb695424e71fde0f914ecf856372.tar.gz
make tests green again
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semstmts.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 1f076aa31..f59acd7be 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -1355,11 +1355,13 @@ proc semMethod(c: PContext, n: PNode): PNode =
   if isGenericRoutine(s):
     let tt = s.typ
     var foundObj = false
-    for col in countup(0, sonsLen(tt)-1):
+    # we start at 1 for now so that tparsecombnum continues to compile.
+    # XXX Revisit this problem later.
+    for col in countup(1, sonsLen(tt)-1):
       let t = tt.sons[col]
       if t != nil and t.kind == tyGenericInvocation:
         var x = skipTypes(t.sons[0], {tyVar, tyPtr, tyRef, tyGenericInst, tyGenericInvocation, tyGenericBody})
-        if x.kind == tyObject:
+        if x.kind == tyObject and t.len-1 == result.sons[genericParamsPos].len:
           foundObj = true
           x.methods.safeAdd((col,s))
     if not foundObj: