Skip to content

Commit ad06d27

Browse files
committed
AST: Remove AbstractTypeParamDecl::getSuperclass()/getConformingProtocols()
1 parent 8113d1f commit ad06d27

File tree

2 files changed

+0
-32
lines changed

2 files changed

+0
-32
lines changed

include/swift/AST/Decl.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3192,13 +3192,6 @@ class AbstractTypeParamDecl : public TypeDecl {
31923192
: TypeDecl(kind, dc, name, NameLoc, { }) { }
31933193

31943194
public:
3195-
/// Return the superclass of the generic parameter.
3196-
Type getSuperclass() const;
3197-
3198-
/// Retrieve the set of protocols to which this abstract type
3199-
/// parameter conforms.
3200-
ArrayRef<ProtocolDecl *> getConformingProtocols() const;
3201-
32023195
static bool classof(const Decl *D) {
32033196
return D->getKind() >= DeclKind::First_AbstractTypeParamDecl &&
32043197
D->getKind() <= DeclKind::Last_AbstractTypeParamDecl;

lib/AST/Decl.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4623,31 +4623,6 @@ Type TypeAliasDecl::getStructuralType() const {
46234623
return ErrorType::get(ctx);
46244624
}
46254625

4626-
Type AbstractTypeParamDecl::getSuperclass() const {
4627-
auto *genericEnv = getDeclContext()->getGenericEnvironmentOfContext();
4628-
assert(genericEnv != nullptr && "Too much circularity");
4629-
4630-
auto contextTy = genericEnv->mapTypeIntoContext(getDeclaredInterfaceType());
4631-
if (auto *archetype = contextTy->getAs<ArchetypeType>())
4632-
return archetype->getSuperclass();
4633-
4634-
// FIXME: Assert that this is never queried.
4635-
return nullptr;
4636-
}
4637-
4638-
ArrayRef<ProtocolDecl *>
4639-
AbstractTypeParamDecl::getConformingProtocols() const {
4640-
auto *genericEnv = getDeclContext()->getGenericEnvironmentOfContext();
4641-
assert(genericEnv != nullptr && "Too much circularity");
4642-
4643-
auto contextTy = genericEnv->mapTypeIntoContext(getDeclaredInterfaceType());
4644-
if (auto *archetype = contextTy->getAs<ArchetypeType>())
4645-
return archetype->getConformsTo();
4646-
4647-
// FIXME: Assert that this is never queried.
4648-
return { };
4649-
}
4650-
46514626
GenericTypeParamDecl::GenericTypeParamDecl(
46524627
DeclContext *dc, Identifier name, SourceLoc nameLoc, SourceLoc ellipsisLoc,
46534628
unsigned depth, unsigned index, bool isParameterPack, bool isOpaqueType,

0 commit comments

Comments
 (0)