Dependencies: Type lookups are private in constraint systems within functions.

This is the start of distinguishing qualified lookups within function bodies
from qualified lookups in a function signature. Both of these use the
function itself as the decl context, so we need to distinguish them manually.

This particular commit doesn't change much because expressions don't often
use TypeMember constraints. But it does help with for-loops!

Swift SVN r23484
This commit is contained in:
Jordan Rose
2014-11-20 20:58:19 +00:00
parent 985cbb8b2a
commit e97764fbd8
6 changed files with 24 additions and 4 deletions

View File

@@ -2757,8 +2757,9 @@ ConstraintSystem::simplifyMemberConstraint(const Constraint &constraint) {
return SolutionKind::Error;
}
auto lookup = TC.lookupMemberType(baseObjTy, name.getBaseName(), DC);
auto lookup = TC.lookupMemberType(baseObjTy, name.getBaseName(), DC,
isa<AbstractFunctionDecl>(DC));
if (!lookup) {
// FIXME: Customize diagnostic to mention types.
recordFailure(constraint.getLocator(), Failure::DoesNotHaveMember,