privateAccess now works with ref | ptr (#17760)
This commit is contained in:
parent
d6c8efa5d4
commit
0a10af5a2c
8 changed files with 149 additions and 15 deletions
|
|
@ -258,7 +258,9 @@ proc fieldVisible*(c: PContext, f: PSym): bool {.inline.} =
|
|||
for module in c.friendModules:
|
||||
if fmoduleId == module.id: return true
|
||||
if f.kind == skField:
|
||||
let symObj = f.owner
|
||||
var symObj = f.owner
|
||||
if symObj.typ.kind in {tyRef, tyPtr}:
|
||||
symObj = symObj.typ[0].sym
|
||||
for scope in allScopes(c.currentScope):
|
||||
for sym in scope.allowPrivateAccess:
|
||||
if symObj.id == sym.id: return true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue