first attempt to fix 'a[i]' handling in generics

This commit is contained in:
Araq 2015-09-12 10:55:28 +02:00
commit 8ef66b973d
13 changed files with 153 additions and 7 deletions

View file

@ -308,7 +308,10 @@ proc semResolvedCall(c: PContext, n: PNode, x: TCandidate): PNode =
let gp = finalCallee.ast.sons[genericParamsPos]
if gp.kind != nkEmpty:
if x.calleeSym.kind notin {skMacro, skTemplate}:
finalCallee = generateInstance(c, x.calleeSym, x.bindings, n.info)
if x.calleeSym.magic == mArrPut:
finalCallee = x.calleeSym
else:
finalCallee = generateInstance(c, x.calleeSym, x.bindings, n.info)
else:
# For macros and templates, the resolved generic params
# are added as normal params.