Skip to content

Commit 69bd0f0

Browse files
committed
AST: Remove OpaqueTypeArchetypeType::getCanonicalInterfaceType()
1 parent 43c33d7 commit 69bd0f0

File tree

3 files changed

+1
-15
lines changed

3 files changed

+1
-15
lines changed

include/swift/AST/Types.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6679,10 +6679,6 @@ class OpaqueTypeArchetypeType final : public ArchetypeType,
66796679
/// Retrieve the set of substitutions applied to the opaque type.
66806680
SubstitutionMap getSubstitutions() const;
66816681

6682-
/// Compute the canonical interface type within the environment of this
6683-
/// opaque type archetype.
6684-
CanType getCanonicalInterfaceType(Type interfaceType);
6685-
66866682
static bool classof(const TypeBase *T) {
66876683
return T->getKind() == TypeKind::OpaqueTypeArchetype;
66886684
}

lib/AST/Type.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3556,14 +3556,6 @@ OpaqueTypeArchetypeType::OpaqueTypeArchetypeType(
35563556
assert(!interfaceType->isParameterPack());
35573557
}
35583558

3559-
CanType OpaqueTypeArchetypeType::getCanonicalInterfaceType(Type interfaceType) {
3560-
auto sig = Environment->getOpaqueTypeDecl()
3561-
->getOpaqueInterfaceGenericSignature();
3562-
CanType canonicalType = interfaceType->getReducedType(sig);
3563-
return Environment->maybeApplyOuterContextSubstitutions(canonicalType)
3564-
->getCanonicalType();
3565-
}
3566-
35673559
OpaqueTypeDecl *OpaqueTypeArchetypeType::getDecl() const {
35683560
return Environment->getOpaqueTypeDecl();
35693561
}

lib/Sema/CSSimplify.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3784,9 +3784,7 @@ ConstraintSystem::matchDeepEqualityTypes(Type type1, Type type2,
37843784

37853785
// It's possible to declare a generic requirement like Self == Self.Iterator
37863786
// where both types are going to be opaque.
3787-
if (!opaque1->getCanonicalInterfaceType(arch1->getInterfaceType())
3788-
->isEqual(
3789-
opaque2->getCanonicalInterfaceType(arch2->getInterfaceType())))
3787+
if (!opaque1->getInterfaceType()->isEqual(opaque2->getInterfaceType()))
37903788
return getTypeMatchFailure(locator);
37913789

37923790
auto args1 = opaque1->getSubstitutions().getReplacementTypes();

0 commit comments

Comments
 (0)