@@ -4596,12 +4596,12 @@ bool ConstraintSystem::repairFailures(
4596
4596
return true ;
4597
4597
4598
4598
// If we could record a generic arguments mismatch instead of this fix,
4599
- // don't record a ContextualMismatch here.
4599
+ // don't record a contextual type mismatch here.
4600
4600
if (hasConversionOrRestriction (ConversionRestrictionKind::DeepEquality))
4601
4601
break ;
4602
4602
4603
- auto *fix = ContextualMismatch ::create (*this , lhs, rhs,
4604
- getConstraintLocator (locator));
4603
+ auto *fix = IgnoreContextualType ::create (*this , lhs, rhs,
4604
+ getConstraintLocator (locator));
4605
4605
conversionsOrFixes.push_back (fix);
4606
4606
break ;
4607
4607
}
@@ -4940,7 +4940,7 @@ bool ConstraintSystem::repairFailures(
4940
4940
if (contextualType->isEqual (rhs)) {
4941
4941
auto *loc = getConstraintLocator (
4942
4942
anchor, LocatorPathElt::ContextualType (purpose));
4943
- if (hasFixFor (loc, FixKind::ContextualMismatch ))
4943
+ if (hasFixFor (loc, FixKind::IgnoreContextualType ))
4944
4944
return true ;
4945
4945
4946
4946
if (contextualType->isVoid () && purpose == CTP_ReturnStmt) {
@@ -4949,7 +4949,7 @@ bool ConstraintSystem::repairFailures(
4949
4949
}
4950
4950
4951
4951
conversionsOrFixes.push_back (
4952
- ContextualMismatch ::create (*this , lhs, rhs, loc));
4952
+ IgnoreContextualType ::create (*this , lhs, rhs, loc));
4953
4953
break ;
4954
4954
}
4955
4955
}
@@ -6708,9 +6708,9 @@ static ConstraintFix *maybeWarnAboutExtraneousCast(
6708
6708
6709
6709
// Always succeed
6710
6710
if (isCastToExpressibleByNilLiteral (cs, origFromType, toType)) {
6711
- return AllowAlwaysSucceedCheckedCast ::create (
6712
- cs, fromType, toType, CheckedCastKind::Coercion,
6713
- cs.getConstraintLocator (locator));
6711
+ return AllowNoopCheckedCast ::create (cs, fromType, toType,
6712
+ CheckedCastKind::Coercion,
6713
+ cs.getConstraintLocator (locator));
6714
6714
}
6715
6715
6716
6716
// If both original are metatypes we have to use them because most of the
@@ -6745,10 +6745,9 @@ static ConstraintFix *maybeWarnAboutExtraneousCast(
6745
6745
cs, origFromType, origToType, castKind,
6746
6746
cs.getConstraintLocator (locator));
6747
6747
} else {
6748
- // No optionals, just a trivial cast that always succeed.
6749
- return AllowAlwaysSucceedCheckedCast::create (
6750
- cs, origFromType, origToType, castKind,
6751
- cs.getConstraintLocator (locator));
6748
+ // No optionals, just a trivial cast that always succeeds.
6749
+ return AllowNoopCheckedCast::create (cs, origFromType, origToType, castKind,
6750
+ cs.getConstraintLocator (locator));
6752
6751
}
6753
6752
}
6754
6753
@@ -11583,16 +11582,19 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
11583
11582
case FixKind::SpecifyLabelToAssociateTrailingClosure:
11584
11583
case FixKind::AllowKeyPathWithoutComponents:
11585
11584
case FixKind::IgnoreInvalidResultBuilderBody:
11585
+ case FixKind::IgnoreResultBuilderWithReturnStmts:
11586
11586
case FixKind::SpecifyContextualTypeForNil:
11587
11587
case FixKind::AllowRefToInvalidDecl:
11588
11588
case FixKind::SpecifyBaseTypeForOptionalUnresolvedMember:
11589
11589
case FixKind::AllowCheckedCastCoercibleOptionalType:
11590
+ case FixKind::AllowNoopCheckedCast:
11590
11591
case FixKind::AllowUnsupportedRuntimeCheckedCast:
11591
- case FixKind::AllowAlwaysSucceedCheckedCast:
11592
11592
case FixKind::AllowInvalidStaticMemberRefOnProtocolMetatype:
11593
11593
case FixKind::AllowWrappedValueMismatch:
11594
11594
case FixKind::RemoveExtraneousArguments:
11595
- case FixKind::SpecifyTypeForPlaceholder: {
11595
+ case FixKind::SpecifyTypeForPlaceholder:
11596
+ case FixKind::AllowAutoClosurePointerConversion:
11597
+ case FixKind::IgnoreKeyPathContextualMismatch: {
11596
11598
return recordFix (fix) ? SolutionKind::Error : SolutionKind::Solved;
11597
11599
}
11598
11600
@@ -11713,7 +11715,11 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
11713
11715
return matchTypes (*elemTy, dictionaryKeyTy, kind, subflags, elemLoc);
11714
11716
}
11715
11717
11716
- case FixKind::ContextualMismatch: {
11718
+ case FixKind::ContextualMismatch:
11719
+ case FixKind::IgnoreContextualType:
11720
+ case FixKind::IgnoreAssignmentDestinationType:
11721
+ case FixKind::AllowConversionThroughInOut:
11722
+ case FixKind::IgnoreCollectionElementContextualMismatch: {
11717
11723
auto impact = 1 ;
11718
11724
11719
11725
auto locator = fix->getLocator ();
@@ -11793,6 +11799,9 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
11793
11799
case FixKind::SpecifyClosureParameterType:
11794
11800
case FixKind::SpecifyClosureReturnType:
11795
11801
case FixKind::AddQualifierToAccessTopLevelName:
11802
+ case FixKind::AddSendableAttribute:
11803
+ case FixKind::DropThrowsAttribute:
11804
+ case FixKind::DropAsyncAttribute:
11796
11805
llvm_unreachable (" handled elsewhere" );
11797
11806
}
11798
11807
0 commit comments