[CS] Remove some uses of hasUnresolvedType in the solver

These should be unreachable now.
This commit is contained in:
Hamish Knight
2025-10-01 22:30:46 +01:00
parent bc88160378
commit f9a4386922
3 changed files with 3 additions and 12 deletions

View File

@@ -115,7 +115,6 @@ static bool isGenericParameter(TypeVariableType *TypeVar) {
bool PotentialBinding::isViableForJoin() const {
return Kind == AllowedBindingKind::Supertypes &&
!BindingType->hasLValueType() &&
!BindingType->hasUnresolvedType() &&
!BindingType->hasTypeVariable() &&
!BindingType->hasPlaceholder() &&
!BindingType->hasUnboundGenericType() &&

View File

@@ -300,7 +300,6 @@ static bool backwardScanAcceptsTrailingClosure(
paramTy->is<ArchetypeType>() ||
paramTy->is<AnyFunctionType>() ||
paramTy->isTypeVariableOrMember() ||
paramTy->is<UnresolvedType>() ||
paramTy->isAny();
}
@@ -10109,8 +10108,7 @@ performMemberLookup(ConstraintKind constraintKind, DeclNameRef memberName,
MemberLookupResult result;
if (instanceTy->isTypeVariableOrMember() ||
instanceTy->is<UnresolvedType>()) {
if (instanceTy->isTypeVariableOrMember()) {
result.OverallResult = MemberLookupResult::Unsolved;
return result;
}

View File

@@ -1166,8 +1166,7 @@ void ConstraintSystem::shrink(Expr *expr) {
auto base = collection.getPointer();
auto isInvalidType = [](Type type) -> bool {
return type.isNull() || type->hasUnresolvedType() ||
type->hasError();
return type.isNull() || type->hasError();
};
// Array type.
@@ -1179,9 +1178,6 @@ void ConstraintSystem::shrink(Expr *expr) {
// Map or Set or any other associated collection type.
if (auto boundGeneric = dyn_cast<BoundGenericType>(base)) {
if (boundGeneric->hasUnresolvedType())
return boundGeneric;
// Avoid handling InlineArray, building a tuple would be wrong, and
// we want to eliminate shrink.
if (boundGeneric->getDecl() == ctx.getInlineArrayDecl())
@@ -1290,9 +1286,7 @@ void ConstraintSystem::shrink(Expr *expr) {
auto elementType = extractElementType(contextualType);
// If we couldn't deduce element type for the collection, let's
// not attempt to solve it.
if (!elementType ||
elementType->hasError() ||
elementType->hasUnresolvedType())
if (!elementType || elementType->hasError())
return;
contextualType = elementType;