Skip to content

Commit bf2519a

Browse files
committed
[Sema] Allow implicit parameter decls to have property wrapper attributes
1 parent 20a52d2 commit bf2519a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/AST/Decl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6733,7 +6733,8 @@ bool VarDecl::hasStorageOrWrapsStorage() const {
67336733
}
67346734

67356735
void VarDecl::visitAuxiliaryDecls(llvm::function_ref<void(VarDecl *)> visit) const {
6736-
if (getDeclContext()->isTypeContext() || isImplicit())
6736+
if (getDeclContext()->isTypeContext() ||
6737+
(isImplicit() && !isa<ParamDecl>(this)))
67376738
return;
67386739

67396740
if (getAttrs().hasAttribute<LazyAttr>()) {

lib/Sema/TypeCheckStorage.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2981,7 +2981,8 @@ PropertyWrapperAuxiliaryVariablesRequest::evaluate(Evaluator &evaluator,
29812981
PropertyWrapperInitializerInfo
29822982
PropertyWrapperInitializerInfoRequest::evaluate(Evaluator &evaluator,
29832983
VarDecl *var) const {
2984-
if (!var->hasAttachedPropertyWrapper() || var->isImplicit())
2984+
if (!var->hasAttachedPropertyWrapper() ||
2985+
(var->isImplicit() && !isa<ParamDecl>(var)))
29852986
return PropertyWrapperInitializerInfo();
29862987

29872988
auto wrapperInfo = var->getAttachedPropertyWrapperTypeInfo(0);

0 commit comments

Comments
 (0)