@@ -1278,7 +1278,7 @@ ConstraintSystem::matchSuperclassTypes(Type type1, Type type2,
1278
1278
if (super1->getClassOrBoundGenericClass () != classDecl2)
1279
1279
continue ;
1280
1280
1281
- return matchTypes (super1, type2, ConstraintKind::Equal ,
1281
+ return matchTypes (super1, type2, ConstraintKind::Bind ,
1282
1282
subflags, locator);
1283
1283
}
1284
1284
@@ -1302,7 +1302,7 @@ ConstraintSystem::matchDeepEqualityTypes(Type type1, Type type2,
1302
1302
1303
1303
// Match up the parents, exactly.
1304
1304
return matchTypes (nominal1->getParent (), nominal2->getParent (),
1305
- ConstraintKind::Equal , subflags,
1305
+ ConstraintKind::Bind , subflags,
1306
1306
locator.withPathElement (ConstraintLocator::ParentType));
1307
1307
}
1308
1308
@@ -1314,7 +1314,7 @@ ConstraintSystem::matchDeepEqualityTypes(Type type1, Type type2,
1314
1314
" Mismatched parents of bound generics" );
1315
1315
if (bound1->getParent ()) {
1316
1316
auto result = matchTypes (bound1->getParent (), bound2->getParent (),
1317
- ConstraintKind::Equal , subflags,
1317
+ ConstraintKind::Bind , subflags,
1318
1318
locator.withPathElement (
1319
1319
ConstraintLocator::ParentType));
1320
1320
if (result.isFailure ())
@@ -1328,7 +1328,7 @@ ConstraintSystem::matchDeepEqualityTypes(Type type1, Type type2,
1328
1328
return getTypeMatchFailure (locator);
1329
1329
}
1330
1330
for (unsigned i = 0 , n = args1.size (); i != n; ++i) {
1331
- auto result = matchTypes (args1[i], args2[i], ConstraintKind::Equal ,
1331
+ auto result = matchTypes (args1[i], args2[i], ConstraintKind::Bind ,
1332
1332
subflags, locator.withPathElement (
1333
1333
LocatorPathElt::getGenericArgument (i)));
1334
1334
@@ -1953,7 +1953,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
1953
1953
if (isa<MetatypeType>(meta1) &&
1954
1954
!(instanceType1->mayHaveSuperclass () &&
1955
1955
instanceType2->getClassOrBoundGenericClass ())) {
1956
- subKind = ConstraintKind::Equal ;
1956
+ subKind = ConstraintKind::Bind ;
1957
1957
}
1958
1958
1959
1959
return matchTypes (
@@ -1979,7 +1979,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
1979
1979
return getTypeMatchFailure (locator);
1980
1980
return matchTypes (cast<LValueType>(desugar1)->getObjectType (),
1981
1981
cast<LValueType>(desugar2)->getObjectType (),
1982
- ConstraintKind::Equal , subflags,
1982
+ ConstraintKind::Bind , subflags,
1983
1983
locator.withPathElement (
1984
1984
ConstraintLocator::LValueConversion));
1985
1985
@@ -1991,7 +1991,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
1991
1991
1992
1992
return matchTypes (cast<InOutType>(desugar1)->getObjectType (),
1993
1993
cast<InOutType>(desugar2)->getObjectType (),
1994
- ConstraintKind::Equal , subflags,
1994
+ ConstraintKind::Bind , subflags,
1995
1995
locator.withPathElement (ConstraintLocator::LValueConversion));
1996
1996
1997
1997
case TypeKind::UnboundGeneric:
@@ -2207,7 +2207,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
2207
2207
auto inoutBaseType = inoutType1->getInOutObjectType ();
2208
2208
2209
2209
Type simplifiedInoutBaseType = getFixedTypeRecursive (
2210
- inoutBaseType, kind == ConstraintKind::Equal );
2210
+ inoutBaseType, /* wantRValue= */ true );
2211
2211
2212
2212
// FIXME: If the base is still a type variable, we can't tell
2213
2213
// what to do here. Might have to try \c ArrayToPointer and make
@@ -2309,7 +2309,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
2309
2309
if (auto *lvt = type1->getAs <LValueType>()) {
2310
2310
if (auto *iot = type2->getAs <InOutType>()) {
2311
2311
return matchTypes (lvt->getObjectType (), iot->getObjectType (),
2312
- ConstraintKind::Equal , subflags,
2312
+ ConstraintKind::Bind , subflags,
2313
2313
locator.withPathElement (
2314
2314
ConstraintLocator::LValueConversion));
2315
2315
}
@@ -2465,13 +2465,13 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
2465
2465
// Determine the constraint kind. For a deep equality constraint, only
2466
2466
// perform equality.
2467
2467
if (*restriction == ConversionRestrictionKind::DeepEquality)
2468
- constraintKind = ConstraintKind::Equal ;
2468
+ constraintKind = ConstraintKind::Bind ;
2469
2469
2470
2470
constraints.push_back (
2471
2471
Constraint::createRestricted (*this , constraintKind, *restriction,
2472
2472
type1, type2, fixedLocator));
2473
2473
2474
- if (constraints.back ()->getKind () == ConstraintKind::Equal )
2474
+ if (constraints.back ()->getKind () == ConstraintKind::Bind )
2475
2475
constraints.back ()->setFavored ();
2476
2476
2477
2477
continue ;
@@ -4090,7 +4090,7 @@ ConstraintSystem::simplifyBridgingConstraint(Type type1,
4090
4090
}
4091
4091
4092
4092
// Make sure we have the bridged value type.
4093
- if (matchTypes (unwrappedToType, bridgedValueType, ConstraintKind::Equal ,
4093
+ if (matchTypes (unwrappedToType, bridgedValueType, ConstraintKind::Bind ,
4094
4094
subflags, locator).isFailure ())
4095
4095
return SolutionKind::Error;
4096
4096
@@ -5686,7 +5686,7 @@ void ConstraintSystem::addConstraint(Requirement req,
5686
5686
kind = ConstraintKind::Subtype;
5687
5687
break ;
5688
5688
case RequirementKind::SameType:
5689
- kind = ConstraintKind::Equal ;
5689
+ kind = ConstraintKind::Bind ;
5690
5690
break ;
5691
5691
case RequirementKind::Layout:
5692
5692
// Only a class constraint can be modeled as a constraint, and only that can
0 commit comments