We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
getInnermostDeclContext()
1 parent 78fc5cd commit 4a3938bCopy full SHA for 4a3938b
lib/SIL/IR/SILFunctionType.cpp
@@ -2868,7 +2868,10 @@ static CanSILFunctionType getSILFunctionTypeForInitAccessor(
2868
AbstractionPattern origType, CanAnyFunctionType substAccessorType,
2869
SILExtInfoBuilder extInfoBuilder, const Conventions &conventions,
2870
SILDeclRef constant) {
2871
- auto *declContext = constant.getInnermostDeclContext();
+ auto *decl = constant.getDecl();
2872
+ DeclContext *declContext = isa<AccessorDecl>(decl)
2873
+ ? cast<AccessorDecl>(decl)->getDeclContext()
2874
+ : cast<VarDecl>(decl)->getDeclContext();
2875
CanGenericSignature genericSig = substAccessorType.getOptGenericSignature();
2876
2877
std::optional<TypeConverter::GenericContextRAII> contextRAII;
0 commit comments