Skip to content

Commit 1d8341b

Browse files
committed
[Sema] Swap init accessor check in MemberwiseInitPropertiesRequest
Currently `init` accessors are always memberwise initialized, but I'm planning on changing that. As such we need to make sure we record the `init` accessor regardless of whether it is included in the memberwise init.
1 parent 17af03d commit 1d8341b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/Sema/TypeCheckStorage.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,6 @@ MemberwiseInitPropertiesRequest::evaluate(Evaluator &evaluator,
386386
SmallPtrSet<VarDecl *, 4> subsumedViaInitAccessor;
387387

388388
for (auto *var : initableVars) {
389-
// We only care about properties that are memberwise initialized.
390-
if (!var->isMemberwiseInitialized(/*preferDeclaredProperties=*/true))
391-
continue;
392-
393389
// If this property has an init accessor, it subsumes all of the stored properties
394390
// that the accessor initializes. Mark those stored properties as being subsumed; we'll
395391
// get back to them later.
@@ -399,6 +395,10 @@ MemberwiseInitPropertiesRequest::evaluate(Evaluator &evaluator,
399395
}
400396
}
401397

398+
// We only care about properties that are memberwise initialized.
399+
if (!var->isMemberwiseInitialized(/*preferDeclaredProperties=*/true))
400+
continue;
401+
402402
// Add this property.
403403
results.push_back(var);
404404
}

0 commit comments

Comments
 (0)