mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Type checker] Eliminate the 'literalConformanceProto' state on type variables.
The 'literalConformanceProto' field of
TypeVariableType::Implementation didn't take into account equivalence
classes of type variables. Eliminate it, and either look at the actual
expressions (for optimizing constraints during constraint generation)
or the actual constraints on a given type variable (for determining
whether to include optionals in the set of potential type variable
bindings).
(cherry picked from commit 6bdd9cfae5)
This commit is contained in:
@@ -2920,7 +2920,8 @@ bool FailureDiagnosis::diagnoseGeneralConversionFailure(Constraint *constraint){
|
||||
// If simplification has turned this into the same types, then this isn't the
|
||||
// broken constraint that we're looking for.
|
||||
if (fromType->isEqual(toType) &&
|
||||
constraint->getKind() != ConstraintKind::ConformsTo)
|
||||
constraint->getKind() != ConstraintKind::ConformsTo &&
|
||||
constraint->getKind() != ConstraintKind::LiteralConformsTo)
|
||||
return false;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user