propagate semExpr flags in macro/template expansion
This commit is contained in:
parent
4d2f1396cb
commit
f6f5c9e9e6
5 changed files with 27 additions and 23 deletions
|
|
@ -539,7 +539,7 @@ proc semPatternBody(c: var TemplCtx, n: PNode): PNode =
|
|||
elif contains(c.toBind, s.id):
|
||||
result = symChoice(c.c, n, s, scClosed)
|
||||
elif templToExpand(s):
|
||||
result = semPatternBody(c, semTemplateExpr(c.c, n, s, false))
|
||||
result = semPatternBody(c, semTemplateExpr(c.c, n, s, {efNoSemCheck}))
|
||||
else:
|
||||
discard
|
||||
# we keep the ident unbound for matching instantiated symbols and
|
||||
|
|
@ -584,7 +584,7 @@ proc semPatternBody(c: var TemplCtx, n: PNode): PNode =
|
|||
if s.owner == c.owner and s.kind == skParam: discard
|
||||
elif contains(c.toBind, s.id): discard
|
||||
elif templToExpand(s):
|
||||
return semPatternBody(c, semTemplateExpr(c.c, n, s, false))
|
||||
return semPatternBody(c, semTemplateExpr(c.c, n, s, {efNoSemCheck}))
|
||||
|
||||
if n.kind == nkInfix and n.sons[0].kind == nkIdent:
|
||||
# we interpret `*` and `|` only as pattern operators if they occur in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue