@@ -2147,7 +2147,6 @@ ConstraintSystem::matchTupleTypes(TupleType *tuple1, TupleType *tuple2,
2147
2147
case ConstraintKind::KeyPathApplication:
2148
2148
case ConstraintKind::LiteralConformsTo:
2149
2149
case ConstraintKind::OptionalObject:
2150
- case ConstraintKind::SelfObjectOfProtocol:
2151
2150
case ConstraintKind::UnresolvedValueMember:
2152
2151
case ConstraintKind::ValueMember:
2153
2152
case ConstraintKind::ValueWitness:
@@ -2509,7 +2508,6 @@ static bool matchFunctionRepresentations(FunctionType::ExtInfo einfo1,
2509
2508
case ConstraintKind::KeyPathApplication:
2510
2509
case ConstraintKind::LiteralConformsTo:
2511
2510
case ConstraintKind::OptionalObject:
2512
- case ConstraintKind::SelfObjectOfProtocol:
2513
2511
case ConstraintKind::UnresolvedValueMember:
2514
2512
case ConstraintKind::ValueMember:
2515
2513
case ConstraintKind::ValueWitness:
@@ -3154,7 +3152,6 @@ ConstraintSystem::matchFunctionTypes(FunctionType *func1, FunctionType *func2,
3154
3152
case ConstraintKind::KeyPathApplication:
3155
3153
case ConstraintKind::LiteralConformsTo:
3156
3154
case ConstraintKind::OptionalObject:
3157
- case ConstraintKind::SelfObjectOfProtocol:
3158
3155
case ConstraintKind::UnresolvedValueMember:
3159
3156
case ConstraintKind::ValueMember:
3160
3157
case ConstraintKind::ValueWitness:
@@ -3981,8 +3978,8 @@ ConstraintSystem::matchExistentialTypes(Type type1, Type type2,
3981
3978
}
3982
3979
3983
3980
if (layout.explicitSuperclass) {
3984
- auto subKind = std::min(ConstraintKind::Subtype, kind);
3985
- auto result = matchTypes(type1, layout.explicitSuperclass, subKind ,
3981
+ auto result = matchTypes(type1, layout.explicitSuperclass,
3982
+ ConstraintKind::Subtype ,
3986
3983
subflags, locator);
3987
3984
if (result.isFailure())
3988
3985
return result;
@@ -6957,7 +6954,6 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
6957
6954
case ConstraintKind::KeyPathApplication:
6958
6955
case ConstraintKind::LiteralConformsTo:
6959
6956
case ConstraintKind::OptionalObject:
6960
- case ConstraintKind::SelfObjectOfProtocol:
6961
6957
case ConstraintKind::UnresolvedValueMember:
6962
6958
case ConstraintKind::ValueMember:
6963
6959
case ConstraintKind::ValueWitness:
@@ -8468,7 +8464,7 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyConformsToConstraint(
8468
8464
// conform -- they only need to contain the protocol, so check that
8469
8465
// separately.
8470
8466
switch (kind) {
8471
- case ConstraintKind::SelfObjectOfProtocol : {
8467
+ case ConstraintKind::Subtype : {
8472
8468
auto conformance = TypeChecker::containsProtocol(
8473
8469
type, protocol, /*allowMissing=*/true);
8474
8470
if (conformance) {
@@ -14268,7 +14264,7 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
14268
14264
case ConversionRestrictionKind::Existential:
14269
14265
addContextualScore();
14270
14266
return matchExistentialTypes(type1, type2,
14271
- ConstraintKind::SelfObjectOfProtocol ,
14267
+ ConstraintKind::Subtype ,
14272
14268
subflags, locator);
14273
14269
14274
14270
// for $< in { <, <c, <oc }:
@@ -15535,7 +15531,6 @@ ConstraintSystem::addConstraintImpl(ConstraintKind kind, Type first,
15535
15531
15536
15532
case ConstraintKind::ConformsTo:
15537
15533
case ConstraintKind::LiteralConformsTo:
15538
- case ConstraintKind::SelfObjectOfProtocol:
15539
15534
return simplifyConformsToConstraint(first, second, kind, locator,
15540
15535
subflags);
15541
15536
@@ -16066,7 +16061,6 @@ ConstraintSystem::simplifyConstraint(const Constraint &constraint) {
16066
16061
16067
16062
case ConstraintKind::ConformsTo:
16068
16063
case ConstraintKind::LiteralConformsTo:
16069
- case ConstraintKind::SelfObjectOfProtocol:
16070
16064
return simplifyConformsToConstraint(
16071
16065
constraint.getFirstType(), constraint.getSecondType(),
16072
16066
constraint.getKind(), constraint.getLocator(), std::nullopt);
0 commit comments