Skip to content

Commit 8269bde

Browse files
committed
AST: Simplify DeclContext::getSelfTypeInContext()
1 parent 361d49a commit 8269bde

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

lib/AST/Decl.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7858,16 +7858,7 @@ ParamDecl *ParamDecl::createImplicit(ASTContext &Context,
78587858

78597859
/// Retrieve the type of 'self' for the given context.
78607860
Type DeclContext::getSelfTypeInContext() const {
7861-
assert(isTypeContext());
7862-
7863-
// For a protocol or extension thereof, the type is 'Self'.
7864-
if (getSelfProtocolDecl()) {
7865-
auto selfType = getProtocolSelfType();
7866-
if (!selfType)
7867-
return ErrorType::get(getASTContext());
7868-
return mapTypeIntoContext(selfType);
7869-
}
7870-
return getDeclaredTypeInContext();
7861+
return mapTypeIntoContext(getSelfInterfaceType());
78717862
}
78727863

78737864
TupleType *BuiltinTupleDecl::getTupleSelfType() const {

0 commit comments

Comments
 (0)