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 @@ -7187,8 +7187,10 @@ bool VarDecl::isMemberwiseInitialized(bool preferDeclaredProperties) const {
7187
7187
// If this is a computed property with `init` accessor, it's
7188
7188
// memberwise initializable when it could be used to initialize
7189
7189
// other stored properties.
7190
- if (auto *init = getAccessor (AccessorKind::Init))
7191
- return init->getAttrs ().hasAttribute <InitializesAttr>();
7190
+ if (hasInitAccessor ()) {
7191
+ if (auto *init = getAccessor (AccessorKind::Init))
7192
+ return init->getAttrs ().hasAttribute <InitializesAttr>();
7193
+ }
7192
7194
7193
7195
// If this is a computed property, it's not memberwise initialized unless
7194
7196
// 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