Templates will pick the candidate in the nearest scope when symbols are mixed-in

This commit is contained in:
Zahary Karadjov 2013-12-31 03:58:31 +02:00
commit 8f3d5a25a6
6 changed files with 32 additions and 16 deletions

View file

@ -421,6 +421,7 @@ proc semTemplateDef(c: PContext, n: PNode): PNode =
else:
s = semIdentVis(c, skTemplate, n.sons[0], {})
# check parameter list:
s.scope = c.currentScope
pushOwner(s)
openScope(c)
n.sons[namePos] = newSymNode(s, n.sons[namePos].info)