mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-18 05:20:31 +00:00
bugfix: make visibility more robust for macros
This commit is contained in:
@@ -398,15 +398,15 @@ proc semIdentVis(c: PContext, kind: TSymKind, n: PNode,
|
||||
allowed: TSymFlags): PSym =
|
||||
# identifier with visibility
|
||||
if n.kind == nkPostfix:
|
||||
if sonsLen(n) == 2 and n.sons[0].kind == nkIdent:
|
||||
if sonsLen(n) == 2:
|
||||
# for gensym'ed identifiers the identifier may already have been
|
||||
# transformed to a symbol and we need to use that here:
|
||||
result = newSymG(kind, n.sons[1], c)
|
||||
var v = n.sons[0].ident
|
||||
var v = considerQuotedIdent(n.sons[0])
|
||||
if sfExported in allowed and v.id == ord(wStar):
|
||||
incl(result.flags, sfExported)
|
||||
else:
|
||||
localError(n.sons[0].info, errInvalidVisibilityX, v.s)
|
||||
localError(n.sons[0].info, errInvalidVisibilityX, renderTree(n[0]))
|
||||
else:
|
||||
illFormedAst(n)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user