Skip to content

Commit f9a4386

Browse files
committed
[CS] Remove some uses of hasUnresolvedType in the solver
These should be unreachable now.
1 parent bc88160 commit f9a4386

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

lib/Sema/CSBindings.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ static bool isGenericParameter(TypeVariableType *TypeVar) {
115115
bool PotentialBinding::isViableForJoin() const {
116116
return Kind == AllowedBindingKind::Supertypes &&
117117
!BindingType->hasLValueType() &&
118-
!BindingType->hasUnresolvedType() &&
119118
!BindingType->hasTypeVariable() &&
120119
!BindingType->hasPlaceholder() &&
121120
!BindingType->hasUnboundGenericType() &&

lib/Sema/CSSimplify.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ static bool backwardScanAcceptsTrailingClosure(
300300
paramTy->is<ArchetypeType>() ||
301301
paramTy->is<AnyFunctionType>() ||
302302
paramTy->isTypeVariableOrMember() ||
303-
paramTy->is<UnresolvedType>() ||
304303
paramTy->isAny();
305304
}
306305

@@ -10109,8 +10108,7 @@ performMemberLookup(ConstraintKind constraintKind, DeclNameRef memberName,
1010910108

1011010109
MemberLookupResult result;
1011110110

10112-
if (instanceTy->isTypeVariableOrMember() ||
10113-
instanceTy->is<UnresolvedType>()) {
10111+
if (instanceTy->isTypeVariableOrMember()) {
1011410112
result.OverallResult = MemberLookupResult::Unsolved;
1011510113
return result;
1011610114
}

lib/Sema/CSSolver.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,8 +1166,7 @@ void ConstraintSystem::shrink(Expr *expr) {
11661166

11671167
auto base = collection.getPointer();
11681168
auto isInvalidType = [](Type type) -> bool {
1169-
return type.isNull() || type->hasUnresolvedType() ||
1170-
type->hasError();
1169+
return type.isNull() || type->hasError();
11711170
};
11721171

11731172
// Array type.
@@ -1179,9 +1178,6 @@ void ConstraintSystem::shrink(Expr *expr) {
11791178

11801179
// Map or Set or any other associated collection type.
11811180
if (auto boundGeneric = dyn_cast<BoundGenericType>(base)) {
1182-
if (boundGeneric->hasUnresolvedType())
1183-
return boundGeneric;
1184-
11851181
// Avoid handling InlineArray, building a tuple would be wrong, and
11861182
// we want to eliminate shrink.
11871183
if (boundGeneric->getDecl() == ctx.getInlineArrayDecl())
@@ -1290,9 +1286,7 @@ void ConstraintSystem::shrink(Expr *expr) {
12901286
auto elementType = extractElementType(contextualType);
12911287
// If we couldn't deduce element type for the collection, let's
12921288
// not attempt to solve it.
1293-
if (!elementType ||
1294-
elementType->hasError() ||
1295-
elementType->hasUnresolvedType())
1289+
if (!elementType || elementType->hasError())
12961290
return;
12971291

12981292
contextualType = elementType;

0 commit comments

Comments
 (0)