@@ -6018,7 +6018,7 @@ bool ConstraintSystem::repairFailures(
6018
6018
// ```
6019
6019
if (rhs->isKnownStdlibCollectionType()) {
6020
6020
std::function<Type(Type)> getArrayOrSetType = [&](Type type) -> Type {
6021
- if (auto eltTy = type->isArrayType ())
6021
+ if (auto eltTy = type->getArrayElementType ())
6022
6022
return getArrayOrSetType(eltTy);
6023
6023
6024
6024
if (auto eltTy = isSetType(type))
@@ -7992,7 +7992,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
7992
7992
if (inoutBaseType->isTypeVariableOrMember())
7993
7993
return formUnsolvedResult();
7994
7994
7995
- auto baseIsArray = inoutBaseType->isArrayType ();
7995
+ auto baseIsArray = inoutBaseType->isArray ();
7996
7996
7997
7997
if (baseIsArray)
7998
7998
conversionsOrFixes.push_back(
@@ -8061,7 +8061,7 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
8061
8061
if (pointerKind == PTK_UnsafePointer
8062
8062
|| pointerKind == PTK_UnsafeRawPointer) {
8063
8063
if (!isAutoClosureArgument) {
8064
- if (type1->isArrayType ()) {
8064
+ if (type1->isArray ()) {
8065
8065
conversionsOrFixes.push_back(
8066
8066
ConversionRestrictionKind::ArrayToPointer);
8067
8067
@@ -9263,7 +9263,7 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyTransitivelyConformsTo(
9263
9263
}
9264
9264
9265
9265
// Array<T> -> Unsafe{Raw}Pointer<T>
9266
- if (auto elt = resolvedTy->isArrayType ()) {
9266
+ if (auto elt = resolvedTy->getArrayElementType ()) {
9267
9267
typesToCheck.push_back(getPointerFor(PTK_UnsafePointer, elt));
9268
9268
typesToCheck.push_back(getPointerFor(PTK_UnsafeRawPointer, elt));
9269
9269
}
@@ -9294,7 +9294,7 @@ static CheckedCastKind getCheckedCastKind(ConstraintSystem *cs,
9294
9294
Type fromType,
9295
9295
Type toType) {
9296
9296
// Array downcasts are handled specially.
9297
- if (fromType->isArrayType () && toType->isArrayType ()) {
9297
+ if (fromType->isArray () && toType->isArray ()) {
9298
9298
return CheckedCastKind::ArrayDowncast;
9299
9299
}
9300
9300
@@ -9558,8 +9558,8 @@ ConstraintSystem::simplifyCheckedCastConstraint(
9558
9558
auto kind = getCheckedCastKind(this, fromType, toType);
9559
9559
switch (kind) {
9560
9560
case CheckedCastKind::ArrayDowncast: {
9561
- auto fromBaseType = fromType->isArrayType ();
9562
- auto toBaseType = toType->isArrayType ();
9561
+ auto fromBaseType = fromType->getArrayElementType ();
9562
+ auto toBaseType = toType->getArrayElementType ();
9563
9563
9564
9564
auto elementLocator =
9565
9565
locator.withPathElement(LocatorPathElt::GenericArgument(0));
@@ -12558,8 +12558,8 @@ ConstraintSystem::simplifyBridgingConstraint(Type type1,
12558
12558
};
12559
12559
12560
12560
// Bridging the elements of an array.
12561
- if (auto fromElement = unwrappedFromType->isArrayType ()) {
12562
- if (auto toElement = unwrappedToType->isArrayType ()) {
12561
+ if (auto fromElement = unwrappedFromType->getArrayElementType ()) {
12562
+ if (auto toElement = unwrappedToType->getArrayElementType ()) {
12563
12563
countOptionalInjections();
12564
12564
auto result = simplifyBridgingConstraint(
12565
12565
fromElement, toElement, subflags,
@@ -14838,7 +14838,7 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
14838
14838
14839
14839
auto t2 = type2->getDesugaredType();
14840
14840
14841
- auto baseType1 = getFixedTypeRecursive(obj1->isArrayType (), false);
14841
+ auto baseType1 = getFixedTypeRecursive(obj1->getArrayElementType (), false);
14842
14842
auto ptr2 = getBaseTypeForPointer(t2);
14843
14843
14844
14844
increaseScore(SK_ValueToOptional, locator, ptr2.getInt());
@@ -14941,7 +14941,7 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
14941
14941
14942
14942
increaseScore(SK_ValueToPointerConversion, locator);
14943
14943
14944
- type1 = getFixedTypeRecursive(type1->getInOutObjectType()->isArrayType (),
14944
+ type1 = getFixedTypeRecursive(type1->getInOutObjectType()->getArrayElementType (),
14945
14945
/*wantRValue=*/false);
14946
14946
LLVM_FALLTHROUGH;
14947
14947
}
@@ -14977,8 +14977,8 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
14977
14977
14978
14978
// T < U or T is bridged to V where V < U ===> Array<T> <c Array<U>
14979
14979
case ConversionRestrictionKind::ArrayUpcast: {
14980
- Type baseType1 = type1->isArrayType ();
14981
- Type baseType2 = type2->isArrayType ();
14980
+ Type baseType1 = type1->getArrayElementType ();
14981
+ Type baseType2 = type2->getArrayElementType ();
14982
14982
14983
14983
increaseScore(SK_CollectionUpcastConversion, locator);
14984
14984
return matchTypes(baseType1,
@@ -15774,7 +15774,7 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyFixConstraint(
15774
15774
auto dictionaryKeyTy = DependentMemberType::get(valueBaseTy, keyAssocTy);
15775
15775
15776
15776
// Extract the array element type.
15777
- auto elemTy = type1->isArrayType ();
15777
+ auto elemTy = type1->getArrayElementType ();
15778
15778
15779
15779
ConstraintLocator *elemLoc = getConstraintLocator(AE->getElement(0));
15780
15780
ConstraintKind kind = isDictionaryType(dictTy)
0 commit comments