Skip to content

Commit c74a751

Browse files
committed
[CS] NFC: Remove OverloadChoiceKind::BaseType
This doesn't appear to be used any more.
1 parent eb93cd6 commit c74a751

File tree

7 files changed

+0
-30
lines changed

7 files changed

+0
-30
lines changed

lib/Sema/CSApply.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3132,9 +3132,6 @@ namespace {
31323132
nameLoc.getBaseNameLoc(), toType));
31333133
}
31343134

3135-
case OverloadChoiceKind::BaseType:
3136-
return base;
3137-
31383135
case OverloadChoiceKind::KeyPathApplication:
31393136
llvm_unreachable("should only happen in a subscript");
31403137

lib/Sema/CSRanking.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ static bool sameOverloadChoice(const OverloadChoice &x,
143143
return false;
144144

145145
switch (x.getKind()) {
146-
case OverloadChoiceKind::BaseType:
147146
case OverloadChoiceKind::KeyPathApplication:
148147
// FIXME: Compare base types after substitution?
149148
return true;
@@ -895,7 +894,6 @@ SolutionCompareResult ConstraintSystem::compareSolutions(
895894
case OverloadChoiceKind::TupleIndex:
896895
continue;
897896

898-
case OverloadChoiceKind::BaseType:
899897
case OverloadChoiceKind::KeyPathApplication:
900898
llvm_unreachable("Never considered different");
901899

lib/Sema/CSSimplify.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ static bool areConservativelyCompatibleArgumentLabels(
135135
decl = choice.getDecl();
136136
break;
137137

138-
case OverloadChoiceKind::BaseType:
139138
// KeyPath application is not filtered in `performMemberLookup`.
140139
case OverloadChoiceKind::KeyPathApplication:
141140
case OverloadChoiceKind::DynamicMemberLookup:

lib/Sema/Constraint.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,6 @@ void Constraint::print(llvm::raw_ostream &Out, SourceManager *sm) const {
405405
case OverloadChoiceKind::KeyPathDynamicMemberLookup:
406406
Out << "dynamic member lookup '" << overload.getName() << "'";
407407
break;
408-
case OverloadChoiceKind::BaseType:
409-
Out << "base type";
410-
break;
411408
case OverloadChoiceKind::TupleIndex:
412409
Out << "tuple index " << overload.getTupleIndex();
413410
break;

lib/Sema/ConstraintSystem.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,6 @@ Type ConstraintSystem::getEffectiveOverloadType(const OverloadChoice &overload,
15491549
// Declaration choices are handled below.
15501550
break;
15511551

1552-
case OverloadChoiceKind::BaseType:
15531552
case OverloadChoiceKind::DeclViaBridge:
15541553
case OverloadChoiceKind::DeclViaDynamic:
15551554
case OverloadChoiceKind::DeclViaUnwrappedOptional:
@@ -1918,7 +1917,6 @@ std::pair<Type, bool> ConstraintSystem::adjustTypeOfOverloadReference(
19181917
case OverloadChoiceKind::DeclViaBridge:
19191918
case OverloadChoiceKind::DeclViaUnwrappedOptional:
19201919
case OverloadChoiceKind::TupleIndex:
1921-
case OverloadChoiceKind::BaseType:
19221920
case OverloadChoiceKind::KeyPathApplication:
19231921
return {refType, bindConstraintCreated};
19241922
case OverloadChoiceKind::DeclViaDynamic: {
@@ -2020,7 +2018,6 @@ void ConstraintSystem::bindOverloadType(
20202018
case OverloadChoiceKind::DeclViaBridge:
20212019
case OverloadChoiceKind::DeclViaUnwrappedOptional:
20222020
case OverloadChoiceKind::TupleIndex:
2023-
case OverloadChoiceKind::BaseType:
20242021
case OverloadChoiceKind::KeyPathApplication:
20252022
case OverloadChoiceKind::DeclViaDynamic:
20262023
bindTypeOrIUO(openedType);
@@ -2272,10 +2269,6 @@ void ConstraintSystem::resolveOverload(ConstraintLocator *locator,
22722269
break;
22732270
}
22742271

2275-
case OverloadChoiceKind::BaseType:
2276-
refType = choice.getBaseType();
2277-
break;
2278-
22792272
case OverloadChoiceKind::TupleIndex:
22802273
if (auto lvalueTy = choice.getBaseType()->getAs<LValueType>()) {
22812274
// When the base of a tuple lvalue, the member is always an lvalue.
@@ -2532,7 +2525,6 @@ DeclName OverloadChoice::getName() const {
25322525
case OverloadChoiceKind::KeyPathDynamicMemberLookup:
25332526
return DeclName(DynamicMember.getPointer());
25342527

2535-
case OverloadChoiceKind::BaseType:
25362528
case OverloadChoiceKind::TupleIndex:
25372529
llvm_unreachable("no name!");
25382530
}
@@ -3246,7 +3238,6 @@ bool ConstraintSystem::diagnoseAmbiguity(ArrayRef<Solution> solutions) {
32463238
// want them to noise up unrelated subscript diagnostics.
32473239
break;
32483240

3249-
case OverloadChoiceKind::BaseType:
32503241
case OverloadChoiceKind::TupleIndex:
32513242
// FIXME: Actually diagnose something here.
32523243
break;

lib/Sema/OverloadChoice.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ enum class OverloadChoiceKind : int {
4040
/// found via dynamic lookup and, therefore, might not actually be
4141
/// available at runtime.
4242
DeclViaDynamic,
43-
/// The overload choice equates the member type with the
44-
/// base type. Used for unresolved member expressions like ".none" that
45-
/// refer to enum members with unit type.
46-
BaseType,
4743
/// The overload choice selects a key path subscripting operation.
4844
KeyPathApplication,
4945
/// The member is looked up using @dynamicMemberLookup.

lib/Sema/TypeCheckConstraints.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3175,10 +3175,6 @@ void Solution::dump(raw_ostream &out) const {
31753175
<< ovl.second.openedType->getString(PO) << "\n";
31763176
break;
31773177

3178-
case OverloadChoiceKind::BaseType:
3179-
out << "base type " << choice.getBaseType()->getString(PO) << "\n";
3180-
break;
3181-
31823178
case OverloadChoiceKind::KeyPathApplication:
31833179
out << "key path application root "
31843180
<< choice.getBaseType()->getString(PO) << "\n";
@@ -3381,10 +3377,6 @@ void ConstraintSystem::print(raw_ostream &out) const {
33813377
<< resolved.openedType->getString(PO) << "\n";
33823378
break;
33833379

3384-
case OverloadChoiceKind::BaseType:
3385-
out << "base type " << choice.getBaseType()->getString(PO) << "\n";
3386-
break;
3387-
33883380
case OverloadChoiceKind::KeyPathApplication:
33893381
out << "key path application root "
33903382
<< choice.getBaseType()->getString(PO) << "\n";

0 commit comments

Comments
 (0)