mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Compute potential bindings with the help of the constraint graph.
Rather than performing a two-pass walk over all of the constraints in the system to attach them to type variables, use the existing type variable -> constraints mapping in the constraint graph to make this a faster single-pass process. Also clarify the type bindings a little bit. Improves type checking time for the standard library by ~3%. Swift SVN r11098
This commit is contained in:
@@ -1426,6 +1426,13 @@ ConstraintSystem::simplifyMemberConstraint(const Constraint &constraint) {
|
||||
choices.push_back(OverloadChoice(baseTy, result.first,
|
||||
/*isSpecialized=*/false));
|
||||
}
|
||||
|
||||
if (choices.empty()) {
|
||||
recordFailure(constraint.getLocator(), Failure::DoesNotHaveMember,
|
||||
baseObjTy, name);
|
||||
return SolutionKind::Error;
|
||||
}
|
||||
|
||||
auto locator = getConstraintLocator(constraint.getLocator());
|
||||
addOverloadSet(memberTy, choices, locator);
|
||||
return SolutionKind::Solved;
|
||||
|
||||
Reference in New Issue
Block a user