diff options
author | Araq <rumpf_a@web.de> | 2012-01-07 20:03:41 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-01-07 20:03:41 +0100 |
commit | 7405278138f4e76d5e6278b3ed25f953ba9260e1 (patch) | |
tree | 7c634a657e72eb4a2aaf1e1a472531daecd6ac99 /compiler/semstmts.nim | |
parent | 0e22a51095d189080ef8af445376fb7ccc061c85 (diff) | |
download | Nim-7405278138f4e76d5e6278b3ed25f953ba9260e1.tar.gz |
bugfix: type alias to generic; generic type not stripped away from for loop variable
Diffstat (limited to 'compiler/semstmts.nim')
-rwxr-xr-x | compiler/semstmts.nim | 5 |
1 files changed, 4 insertions, 1 deletions
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: |