Add a 'current module' parameter to lookupVisibleDecls() so that it can do what

is documented: look up members of a type that are visible from a specific
module.  It does not matter much now, but when we have access control, it will.

Before this change, lookupVisibleDecls() tried to guess the *defining* module
of the type, and gave up if it could not.  It forced us to duplicate some
lookup logic for some types (archetypes and protocol compositions).  Also add a
test that lookup finds members of archetype's superclass, which the original
(duplicated) code did not handle.


Swift SVN r6363
This commit is contained in:
Dmitri Hrybenko
2013-07-18 23:32:16 +00:00
parent 16063866ed
commit e4b44a6bbb
4 changed files with 18 additions and 51 deletions

View File

@@ -545,7 +545,7 @@ public:
}
}
if (!Done) {
lookupVisibleDecls(*this, ExprType);
lookupVisibleDecls(*this, ExprType, *CurrDeclContext->getParentModule());
}
// Add the special qualified keyword 'metatype' so that, for example,
// 'Int.metatype' can be completed.