[Constraint solver] Remove 'type member' constraint.

Only some fallback code in the for-each binding checking code was
using this constraint. Implement those checks more directly.
This commit is contained in:
Doug Gregor
2016-11-06 22:52:03 -08:00
parent ed0955aa8e
commit e20464a02c
7 changed files with 10 additions and 145 deletions

View File

@@ -1336,32 +1336,6 @@ public:
resolveOverload(locator, boundTy, choice);
}
/// \brief Add a value member constraint to the constraint system.
void addTypeMemberConstraint(Type baseTy, DeclName name, Type memberTy,
ConstraintLocatorBuilder locator) {
assert(baseTy);
assert(memberTy);
assert(name);
switch (simplifyMemberConstraint(ConstraintKind::TypeMember, baseTy, name,
memberTy, FunctionRefKind::Compound,
TMF_GenerateConstraints, locator)) {
case SolutionKind::Unsolved:
llvm_unreachable("Unsolved result when generating constraints!");
case SolutionKind::Solved:
break;
case SolutionKind::Error:
if (shouldAddNewFailingConstraint()) {
addNewFailingConstraint(
Constraint::create(*this, ConstraintKind::TypeMember, baseTy,
memberTy, name, FunctionRefKind::Compound,
getConstraintLocator(locator)));
}
break;
}
}
/// \brief Add a value member constraint to the constraint system.
void addValueMemberConstraint(Type baseTy, DeclName name, Type memberTy,
FunctionRefKind functionRefKind,