mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[CS] Remove some uses of hasUnresolvedType in the solver
These should be unreachable now.
This commit is contained in:
@@ -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() &&
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user