Skip to content

Commit a1f0b8b

Browse files
committed
Refactor declContext extraction
1 parent 3a60402 commit a1f0b8b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/SIL/IR/SILFunctionType.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2868,10 +2868,7 @@ static CanSILFunctionType getSILFunctionTypeForInitAccessor(
28682868
AbstractionPattern origType, CanAnyFunctionType substAccessorType,
28692869
SILExtInfoBuilder extInfoBuilder, const Conventions &conventions,
28702870
SILDeclRef constant) {
2871-
auto *decl = constant.getDecl();
2872-
DeclContext *declContext = isa<AccessorDecl>(decl)
2873-
? cast<AccessorDecl>(decl)->getDeclContext()
2874-
: cast<VarDecl>(decl)->getDeclContext();
2871+
auto *declContext = constant.getDecl()->getDeclContext();
28752872
CanGenericSignature genericSig = substAccessorType.getOptGenericSignature();
28762873

28772874
std::optional<TypeConverter::GenericContextRAII> contextRAII;

0 commit comments

Comments
 (0)