File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -7178,8 +7178,10 @@ bool VarDecl::isMemberwiseInitialized(bool preferDeclaredProperties) const {
7178
7178
// If this is a computed property with `init` accessor, it's
7179
7179
// memberwise initializable when it could be used to initialize
7180
7180
// other stored properties.
7181
- if (auto *init = getAccessor (AccessorKind::Init))
7182
- return init->getAttrs ().hasAttribute <InitializesAttr>();
7181
+ if (hasInitAccessor ()) {
7182
+ if (auto *init = getAccessor (AccessorKind::Init))
7183
+ return init->getAttrs ().hasAttribute <InitializesAttr>();
7184
+ }
7183
7185
7184
7186
// If this is a computed property, it's not memberwise initialized unless
7185
7187
// the caller has asked for the declared properties and it is either a
You can’t perform that action at this time.
0 commit comments