Merge pull request #3500 from nanoant/patch/fix-3498-generic-args-in-tmpl

fixes #3498
This commit is contained in:
Andreas Rumpf 2016-01-14 15:03:53 +01:00
commit 2e62090ec3
3 changed files with 20 additions and 13 deletions

View file

@ -38,7 +38,8 @@ proc evalTemplateAux(templ, actual: PNode, c: var TemplCtx, result: PNode) =
if s.owner.id == c.owner.id:
if s.kind == skParam and sfGenSym notin s.flags:
handleParam actual.sons[s.position]
elif s.kind == skGenericParam:
elif s.kind == skGenericParam or
s.kind == skType and s.typ != nil and s.typ.kind == tyGenericParam:
handleParam actual.sons[s.owner.typ.len + s.position - 1]
else:
internalAssert sfGenSym in s.flags