Skip to content

Commit cd79b54

Browse files
committed
AST: Remove ProtocolDecl's overload of getDeclaredType()
1 parent 0d7a07c commit cd79b54

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

include/swift/AST/Decl.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4310,11 +4310,6 @@ class ProtocolDecl final : public NominalTypeDecl {
43104310
/// protocol.
43114311
bool inheritsFrom(const ProtocolDecl *Super) const;
43124312

4313-
ProtocolType *getDeclaredType() const {
4314-
return reinterpret_cast<ProtocolType *>(
4315-
NominalTypeDecl::getDeclaredType().getPointer());
4316-
}
4317-
43184313
SourceLoc getStartLoc() const { return ProtocolLoc; }
43194314
SourceRange getSourceRange() const {
43204315
return SourceRange(ProtocolLoc, getBraces().End);

lib/AST/ASTPrinter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4102,7 +4102,8 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
41024102
case SILFunctionType::Representation::WitnessMethod:
41034103
Printer << "witness_method: ";
41044104
printTypeDeclName(
4105-
witnessMethodConformance.getRequirement()->getDeclaredType());
4105+
witnessMethodConformance.getRequirement()->getDeclaredType()
4106+
->castTo<ProtocolType>());
41064107
break;
41074108
case SILFunctionType::Representation::Closure:
41084109
Printer << "closure";

0 commit comments

Comments
 (0)