Skip to content

Commit cea72e3

Browse files
committed
AST: Remove ProtocolConformanceRef::getAssociatedType()
1 parent 44b73b9 commit cea72e3

File tree

3 files changed

+0
-19
lines changed

3 files changed

+0
-19
lines changed

include/swift/AST/ProtocolConformance.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,6 @@ class alignas(1 << DeclAlignInBits) ProtocolConformance
363363
/// Retrieve the protocol conformance for the inherited protocol.
364364
ProtocolConformance *getInheritedConformance(ProtocolDecl *protocol) const;
365365

366-
/// Given a dependent type expressed in terms of the self parameter,
367-
/// map it into the context of this conformance.
368-
Type getAssociatedType(Type assocType) const;
369-
370366
/// Given that the requirement signature of the protocol directly states
371367
/// that the given dependent type must conform to the given protocol,
372368
/// return its associated conformance.

lib/AST/ProtocolConformance.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -623,14 +623,6 @@ void NormalProtocolConformance::setTypeWitness(AssociatedTypeDecl *assocType,
623623
TypeWitnesses[assocType] = {type, typeDecl};
624624
}
625625

626-
Type ProtocolConformance::getAssociatedType(Type assocType) const {
627-
assert(assocType->isTypeParameter() &&
628-
"associated type must be a type parameter");
629-
630-
ProtocolConformanceRef ref(const_cast<ProtocolConformance*>(this));
631-
return ref.getAssociatedType(assocType);
632-
}
633-
634626
ProtocolConformanceRef
635627
ProtocolConformance::getAssociatedConformance(Type assocType,
636628
ProtocolDecl *protocol) const {

lib/AST/ProtocolConformanceRef.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,13 +210,6 @@ Type ProtocolConformanceRef::getTypeWitness(AssociatedTypeDecl *assocType,
210210
return DependentMemberType::get(conformingType, assocType);
211211
}
212212

213-
Type ProtocolConformanceRef::getAssociatedType(Type assocType) const {
214-
if (isInvalid())
215-
return ErrorType::get(assocType->getASTContext());
216-
217-
return assocType.subst(SubstitutionMap::getProtocolSubstitutions(*this));
218-
}
219-
220213
ProtocolConformanceRef
221214
ProtocolConformanceRef::getAssociatedConformance(Type assocType,
222215
ProtocolDecl *protocol) const {

0 commit comments

Comments
 (0)