Re-lazify the addition of equatable conformances to imported enum types. (rdar://problem/16808612)

Rather than force conformances to Equatable to be added to all imported enumeration types outright, change them back to being lazily added. We can then handle situations where new overloads of '==' are introduced during constraint generation by re-writing the relevant overload disjunction constraint to include the newly forced declarations as bind options.

Swift SVN r17557
This commit is contained in:
Joe Pamer
2014-05-06 19:56:29 +00:00
parent 9336c8f84f
commit d22ffa8cb8
9 changed files with 158 additions and 37 deletions

View File

@@ -2318,6 +2318,13 @@ ConstraintSystem::simplifyMemberConstraint(const Constraint &constraint) {
continue;
}
}
// If the result's type contains delayed members, we need to force them now.
if (auto NT = dyn_cast<NominalType>(result->getType().getPointer())) {
if (auto *NTD = dyn_cast<NominalTypeDecl>(NT->getDecl())) {
TC.forceExternalDeclMembers(NTD);
}
}
// If we're looking into an existential type, check whether this
// result was found via dynamic lookup.