Skip to content

Commit 6d287be

Browse files
committed
[Sema] Remove redundant check
The initializer for a lazy property is always subsumed, so we should have already bailed.
1 parent 999169e commit 6d287be

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/Sema/TypeCheckCaptures.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -857,12 +857,6 @@ CaptureInfo ParamCaptureInfoRequest::evaluate(Evaluator &evaluator,
857857
return finder.getCaptureInfo();
858858
}
859859

860-
static bool isLazy(PatternBindingDecl *PBD) {
861-
if (auto var = PBD->getSingleVar())
862-
return var->getAttrs().hasAttribute<LazyAttr>();
863-
return false;
864-
}
865-
866860
CaptureInfo PatternBindingCaptureInfoRequest::evaluate(Evaluator &evaluator,
867861
PatternBindingDecl *PBD,
868862
unsigned int idx) const {
@@ -883,7 +877,7 @@ CaptureInfo PatternBindingCaptureInfoRequest::evaluate(Evaluator &evaluator,
883877
init->walk(finder);
884878

885879
auto &ctx = DC->getASTContext();
886-
if (finder.getDynamicSelfCaptureLoc().isValid() && !isLazy(PBD)) {
880+
if (finder.getDynamicSelfCaptureLoc().isValid()) {
887881
ctx.Diags.diagnose(finder.getDynamicSelfCaptureLoc(),
888882
diag::dynamic_self_stored_property_init);
889883
}

0 commit comments

Comments
 (0)