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.
1 parent cffc3fd commit 6ca9728Copy full SHA for 6ca9728
lib/AST/Decl.cpp
@@ -7132,6 +7132,12 @@ bool VarDecl::isMemberwiseInitialized(bool preferDeclaredProperties) const {
7132
isBackingStorageForDeclaredProperty(this))
7133
return false;
7134
7135
+ // If this is a computed property with `init` accessor, it's
7136
+ // memberwise initializable when it could be used to initialize
7137
+ // other stored properties.
7138
+ if (auto *init = getAccessor(AccessorKind::Init))
7139
+ return init->getAttrs().hasAttribute<InitializesAttr>();
7140
+
7141
// If this is a computed property, it's not memberwise initialized unless
7142
// the caller has asked for the declared properties and it is either a
7143
// `lazy` property or a property with an attached wrapper.
0 commit comments