File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -1879,6 +1879,17 @@ class SolutionApplicationTarget {
1879
1879
!expression.pattern ->isImplicit ();
1880
1880
}
1881
1881
1882
+ // / Check whether this is an initializaion for `async let` pattern.
1883
+ bool isAsyncLetInitializer () const {
1884
+ if (!(kind == Kind::expression &&
1885
+ expression.contextualPurpose == CTP_Initialization))
1886
+ return false ;
1887
+
1888
+ if (auto *PBD = getInitializationPatternBindingDecl ())
1889
+ return PBD->isAsyncLet ();
1890
+ return false ;
1891
+ }
1892
+
1882
1893
// / Whether to bind the types of any variables within the pattern via
1883
1894
// / one-way constraints.
1884
1895
bool shouldBindPatternVarsOneWay () const {
Original file line number Diff line number Diff line change @@ -8279,12 +8279,9 @@ static Optional<SolutionApplicationTarget> applySolutionToInitialization(
8279
8279
8280
8280
// For an async let, wrap the initializer appropriately to make it a child
8281
8281
// task.
8282
- if (auto patternBinding = target.getInitializationPatternBindingDecl ()) {
8283
- if (patternBinding->isAsyncLet ()) {
8284
- resultTarget.setExpr (
8285
- wrapAsyncLetInitializer (
8286
- cs, resultTarget.getAsExpr (), resultTarget.getDeclContext ()));
8287
- }
8282
+ if (target.isAsyncLetInitializer ()) {
8283
+ resultTarget.setExpr (wrapAsyncLetInitializer (
8284
+ cs, resultTarget.getAsExpr (), resultTarget.getDeclContext ()));
8288
8285
}
8289
8286
8290
8287
return resultTarget;
You can’t perform that action at this time.
0 commit comments