bugfix: type alias to generic; generic type not stripped away from for loop variable
This commit is contained in:
parent
0e22a51095
commit
7405278138
8 changed files with 118 additions and 69 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue