From f7f3d70a683bca1113764f9552417a52cc3fe62e Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Wed, 1 Jun 2016 11:00:55 +0200 Subject: [PATCH] bugfix: make visibility more robust for macros --- compiler/semtypes.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 9d0afd8b1..e1a893a09 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -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: