Revert r30787, r30789, r30795, r30796, r30797

r30787 causes our tests to time out; the other commits depend on r30787.

Revert "revert part of my previous patch."
Revert "Produce more specific diagnostics relating to different kinds of invalid"
Revert "add a testcase, nfc"
Revert "- Reimplement FailureDiagnosis::diagnoseGeneralMemberFailure in terms of"
Revert "Fix places in the constraint solver where it would give up once a single "

Swift SVN r30805
This commit is contained in:
Ben Langmuir
2015-07-30 17:44:22 +00:00
parent c5ebe153d1
commit c1a2955ef6
20 changed files with 217 additions and 203 deletions

View File

@@ -2727,10 +2727,6 @@ getArgumentLabels(ConstraintSystem &cs, ConstraintLocatorBuilder locator) {
return known->second;
}
/// Given a ValueMember, UnresolvedValueMember, or TypeMember constraint,
/// perform a lookup into the specified base type to find a candidate list.
/// The list returned includes the viable candidates as well as the unviable
/// ones (along with reasons why they aren't viable).
MemberLookupResult ConstraintSystem::
performMemberLookup(Type baseTy, const Constraint &constraint) {
Type baseObjTy = baseTy->getRValueType();
@@ -2891,8 +2887,10 @@ performMemberLookup(Type baseTy, const Constraint &constraint) {
for (auto constructor : ctors) {
// If the constructor is invalid, we fail entirely to avoid error cascade.
TC.validateDecl(constructor, true);
if (constructor->isInvalid())
return result.markErrorAlreadyDiagnosed();
if (constructor->isInvalid()) {
continue;
// FIXME: return result.markErrorAlreadyDiagnosed();
}
// If the argument labels for this result are incompatible with
// the call site, skip it.
@@ -2969,8 +2967,10 @@ performMemberLookup(Type baseTy, const Constraint &constraint) {
for (auto candidate : lookup) {
// If the result is invalid, don't cascade errors.
TC.validateDecl(candidate.first, true);
if (candidate.first->isInvalid())
return result.markErrorAlreadyDiagnosed();
if (candidate.first->isInvalid()) {
continue;
//FIXME: return result.markErrorAlreadyDiagnosed();
}
result.addViable(OverloadChoice(baseTy, candidate.first,
/*isSpecialized=*/false));
@@ -3006,7 +3006,7 @@ performMemberLookup(Type baseTy, const Constraint &constraint) {
// If the result is invalid, skip it.
TC.validateDecl(cand, true);
if (cand->isInvalid()) {
result.markErrorAlreadyDiagnosed();
//FIXME: result.markErrorAlreadyDiagnosed();
return;
}
@@ -3178,7 +3178,6 @@ ConstraintSystem::simplifyMemberConstraint(const Constraint &constraint) {
baseTy = objTy;
}
// FIXME: The third bool argument should be eliminated here.
MemberLookupResult result = performMemberLookup(baseTy, constraint);
DeclName name = constraint.getMember();
@@ -4554,7 +4553,7 @@ ConstraintSystem::simplifyConstraint(const Constraint &constraint) {
// Process all of the constraints in the conjunction.
for (auto con : constraint.getNestedConstraints()) {
addConstraint(con);
if (failedConstraint && !shouldRecordFailures())
if (failedConstraint)
return SolutionKind::Error;
}
return SolutionKind::Solved;