fixes a critical bug about template instantiations in generics

This commit is contained in:
Andreas Rumpf 2016-06-05 16:43:13 +02:00
commit 03b64327ca

View file

@ -205,7 +205,7 @@ proc semGenericStmt(c: PContext, n: PNode,
if macroToExpand(s): if macroToExpand(s):
styleCheckUse(fn.info, s) styleCheckUse(fn.info, s)
result = semMacroExpr(c, n, n, s, {efNoSemCheck}) result = semMacroExpr(c, n, n, s, {efNoSemCheck})
result = semGenericStmt(c, result, {}, ctx) result = semGenericStmt(c, result, flags, ctx)
else: else:
n.sons[0] = symChoice(c, fn, s, scOption) n.sons[0] = symChoice(c, fn, s, scOption)
result = n result = n
@ -214,7 +214,7 @@ proc semGenericStmt(c: PContext, n: PNode,
if macroToExpand(s): if macroToExpand(s):
styleCheckUse(fn.info, s) styleCheckUse(fn.info, s)
result = semTemplateExpr(c, n, s, {efNoSemCheck}) result = semTemplateExpr(c, n, s, {efNoSemCheck})
result = semGenericStmt(c, result, {}, ctx) result = semGenericStmt(c, result, flags, ctx)
else: else:
n.sons[0] = symChoice(c, fn, s, scOption) n.sons[0] = symChoice(c, fn, s, scOption)
result = n result = n