idetools: don't suggest module names or not visible object fields

This commit is contained in:
Araq
2012-08-03 22:57:26 +02:00
parent 344438ce6a
commit a7a2f464a2
2 changed files with 21 additions and 18 deletions

View File

@@ -866,10 +866,8 @@ proc builtinFieldAccess(c: PContext, n: PNode, flags: TExprFlags): PNode =
if f != nil: break
if ty.sons[0] == nil: break
ty = skipTypes(ty.sons[0], {tyGenericInst})
if f != nil:
var fmoduleId = getModule(f).id
if sfExported in f.flags or fmoduleId == c.module.id or
fmoduleId == c.friendModule.id:
if f != nil:
if fieldVisible(c, f):
# is the access to a public field or in the same module or in a friend?
n.sons[0] = makeDeref(n.sons[0])
n.sons[1] = newSymNode(f) # we now have the correct field