mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-15 07:43:26 +00:00
fixes double object field symbol lookups (no test case available) (#10450)
This commit is contained in:
@@ -1291,7 +1291,11 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
||||
if ty.sons[0] == nil: break
|
||||
ty = skipTypes(ty.sons[0], skipPtrs)
|
||||
if f != nil:
|
||||
if fieldVisible(c, f):
|
||||
let visibilityCheckNeeded =
|
||||
if n[1].kind == nkSym and n[1].sym == f:
|
||||
false # field lookup was done already, likely by hygienic template or bindSym
|
||||
else: true
|
||||
if not visibilityCheckNeeded or fieldVisible(c, f):
|
||||
# is the access to a public field or in the same module or in a friend?
|
||||
markUsed(c.config, n.sons[1].info, f, c.graph.usageSym)
|
||||
onUse(n.sons[1].info, f)
|
||||
|
||||
Reference in New Issue
Block a user