From 7405278138f4e76d5e6278b3ed25f953ba9260e1 Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 7 Jan 2012 20:03:41 +0100 Subject: bugfix: type alias to generic; generic type not stripped away from for loop variable --- compiler/semstmts.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/semstmts.nim') diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index fdb2bfe36..52a3853f2 100755 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -417,7 +417,10 @@ proc semFor(c: PContext, n: PNode): PNode = if iter.kind != tyTuple or length == 3: if length != 3: GlobalError(n.info, errWrongNumberOfVariables) var v = newSymS(skForVar, n.sons[0], c) - v.typ = iter + # BUGFIX: don't use `iter` here as that would strip away + # the ``tyGenericInst``! See ``tests/compile/tgeneric.nim`` + # for an example: + v.typ = n.sons[length-2].typ n.sons[0] = newSymNode(v) addDecl(c, v) else: -- cgit 1.4.1-2-gfad0