@@ -4596,12 +4596,12 @@ bool ConstraintSystem::repairFailures(
45964596 return true ;
45974597
45984598 // 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.
46004600 if (hasConversionOrRestriction (ConversionRestrictionKind::DeepEquality))
46014601 break ;
46024602
4603- auto *fix = ContextualMismatch ::create (*this , lhs, rhs,
4604- getConstraintLocator (locator));
4603+ auto *fix = IgnoreContextualType ::create (*this , lhs, rhs,
4604+ getConstraintLocator (locator));
46054605 conversionsOrFixes.push_back (fix);
46064606 break ;
46074607 }
@@ -4940,7 +4940,7 @@ bool ConstraintSystem::repairFailures(
49404940 if (contextualType->isEqual (rhs)) {
49414941 auto *loc = getConstraintLocator (
49424942 anchor, LocatorPathElt::ContextualType (purpose));
4943- if (hasFixFor (loc, FixKind::ContextualMismatch ))
4943+ if (hasFixFor (loc, FixKind::IgnoreContextualType ))
49444944 return true ;
49454945
49464946 if (contextualType->isVoid () && purpose == CTP_ReturnStmt) {
@@ -4949,7 +4949,7 @@ bool ConstraintSystem::repairFailures(
49494949 }
49504950
49514951 conversionsOrFixes.push_back (
4952- ContextualMismatch ::create (*this , lhs, rhs, loc));
4952+ IgnoreContextualType ::create (*this , lhs, rhs, loc));
49534953 break ;
49544954 }
49554955 }
@@ -6708,9 +6708,9 @@ static ConstraintFix *maybeWarnAboutExtraneousCast(
67086708
67096709 // Always succeed
67106710 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));
67146714 }
67156715
67166716 // If both original are metatypes we have to use them because most of the
@@ -6745,10 +6745,9 @@ static ConstraintFix *maybeWarnAboutExtraneousCast(
67456745 cs, origFromType, origToType, castKind,
67466746 cs.getConstraintLocator (locator));
67476747 } 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));
67526751 }
67536752}
67546753
@@ -11583,16 +11582,19 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
1158311582 case FixKind::SpecifyLabelToAssociateTrailingClosure:
1158411583 case FixKind::AllowKeyPathWithoutComponents:
1158511584 case FixKind::IgnoreInvalidResultBuilderBody:
11585+ case FixKind::IgnoreResultBuilderWithReturnStmts:
1158611586 case FixKind::SpecifyContextualTypeForNil:
1158711587 case FixKind::AllowRefToInvalidDecl:
1158811588 case FixKind::SpecifyBaseTypeForOptionalUnresolvedMember:
1158911589 case FixKind::AllowCheckedCastCoercibleOptionalType:
11590+ case FixKind::AllowNoopCheckedCast:
1159011591 case FixKind::AllowUnsupportedRuntimeCheckedCast:
11591- case FixKind::AllowAlwaysSucceedCheckedCast:
1159211592 case FixKind::AllowInvalidStaticMemberRefOnProtocolMetatype:
1159311593 case FixKind::AllowWrappedValueMismatch:
1159411594 case FixKind::RemoveExtraneousArguments:
11595- case FixKind::SpecifyTypeForPlaceholder: {
11595+ case FixKind::SpecifyTypeForPlaceholder:
11596+ case FixKind::AllowAutoClosurePointerConversion:
11597+ case FixKind::IgnoreKeyPathContextualMismatch: {
1159611598 return recordFix (fix) ? SolutionKind::Error : SolutionKind::Solved;
1159711599 }
1159811600
@@ -11713,7 +11715,11 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
1171311715 return matchTypes (*elemTy, dictionaryKeyTy, kind, subflags, elemLoc);
1171411716 }
1171511717
11716- case FixKind::ContextualMismatch: {
11718+ case FixKind::ContextualMismatch:
11719+ case FixKind::IgnoreContextualType:
11720+ case FixKind::IgnoreAssignmentDestinationType:
11721+ case FixKind::AllowConversionThroughInOut:
11722+ case FixKind::IgnoreCollectionElementContextualMismatch: {
1171711723 auto impact = 1 ;
1171811724
1171911725 auto locator = fix->getLocator ();
@@ -11793,6 +11799,9 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
1179311799 case FixKind::SpecifyClosureParameterType:
1179411800 case FixKind::SpecifyClosureReturnType:
1179511801 case FixKind::AddQualifierToAccessTopLevelName:
11802+ case FixKind::AddSendableAttribute:
11803+ case FixKind::DropThrowsAttribute:
11804+ case FixKind::DropAsyncAttribute:
1179611805 llvm_unreachable (" handled elsewhere" );
1179711806 }
1179811807
0 commit comments