Skip to content

Commit 69c439b

Browse files
Revertive extra flag
1 parent a6b415e commit 69c439b

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

lib/Sema/CSGen.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -2666,15 +2666,13 @@ namespace {
26662666
// Add a conversion constraint for the direct conversion between
26672667
// types.
26682668
CS.addExplicitConversionConstraint(fromType, toType,
2669-
/*allowFixes=*/true,
2670-
/*addCoercionPathElt*/true,
2671-
locator);
2669+
/*allowFixes=*/true, locator);
26722670

26732671
// If the result type was declared IUO, add a disjunction for
26742672
// bindings for the result of the coercion.
26752673
auto *TR = expr->getCastTypeLoc().getTypeRepr();
26762674
if (TR && TR->getKind() == TypeReprKind::ImplicitlyUnwrappedOptional)
2677-
return createTypeVariableAndDisjunctionForIUOCoercion(toType, CS.getConstraintLocator(expr));
2675+
return createTypeVariableAndDisjunctionForIUOCoercion(toType, locator);
26782676

26792677
return toType;
26802678
}

lib/Sema/CSSimplify.cpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -5786,12 +5786,10 @@ ConstraintSystem::simplifyBridgingConstraint(Type type1,
57865786
if (auto toKeyValue = isDictionaryType(unwrappedToType)) {
57875787
addExplicitConversionConstraint(fromKeyValue->first, toKeyValue->first,
57885788
/*allowFixes=*/false,
5789-
/*addCoercionPathElt*/false,
57905789
locator.withPathElement(
57915790
LocatorPathElt::GenericArgument(0)));
57925791
addExplicitConversionConstraint(fromKeyValue->second, toKeyValue->second,
57935792
/*allowFixes=*/false,
5794-
/*addCoercionPathElt*/false,
57955793
locator.withPathElement(
57965794
LocatorPathElt::GenericArgument(0)));
57975795
countOptionalInjections();
@@ -7772,13 +7770,12 @@ void ConstraintSystem::addConstraint(ConstraintKind kind, Type first,
77727770
void ConstraintSystem::addExplicitConversionConstraint(
77737771
Type fromType, Type toType,
77747772
bool allowFixes,
7775-
bool addCoercionPathElt,
77767773
ConstraintLocatorBuilder locator) {
77777774
SmallVector<Constraint *, 3> constraints;
77787775

77797776
auto locatorPtr = getConstraintLocator(locator);
77807777
auto coerceLocator = [&]() {
7781-
if (addCoercionPathElt && shouldAttemptFixes()) {
7778+
if (allowFixes && shouldAttemptFixes()) {
77827779
if (auto *expr = dyn_cast_or_null<CoerceExpr>(locator.getAnchor())) {
77837780
// Only adding this path for explicty coercions e.g _ = a as Int
77847781
// and also only for left-side is a DeclRefExpr or a

lib/Sema/ConstraintSystem.h

-1
Original file line numberDiff line numberDiff line change
@@ -2191,7 +2191,6 @@ class ConstraintSystem {
21912191
/// Add an explicit conversion constraint (e.g., \c 'x as T').
21922192
void addExplicitConversionConstraint(Type fromType, Type toType,
21932193
bool allowFixes,
2194-
bool addCoercionPathElt,
21952194
ConstraintLocatorBuilder locator);
21962195

21972196
/// Add a disjunction constraint.

0 commit comments

Comments
 (0)