@@ -2344,11 +2344,35 @@ PatternBindingDecl::getInitializerIsolation(unsigned i) const {
23442344 return var->getInitializerIsolation ();
23452345}
23462346
2347+ Expr *PatternBindingDecl::getContextualizedInit (unsigned i) const {
2348+ auto *mutableThis = const_cast <PatternBindingDecl *>(this );
2349+ return evaluateOrDefault (
2350+ getASTContext ().evaluator ,
2351+ PatternBindingCheckedAndContextualizedInitRequest{mutableThis, i},
2352+ nullptr );
2353+ }
2354+
23472355Expr *PatternBindingDecl::getCheckedAndContextualizedInit (unsigned i) const {
2348- return evaluateOrDefault (getASTContext ().evaluator ,
2349- PatternBindingCheckedAndContextualizedInitRequest{
2350- const_cast <PatternBindingDecl *>(this ), i},
2351- nullptr );
2356+ auto *expr = getContextualizedInit (i);
2357+
2358+ if (auto *initContext = getInitContext (i)) {
2359+ // Property wrapper isolation is checked separately while
2360+ // synthesizing the backing property wrapper initializer.
2361+ auto *var = getSingleVar ();
2362+ if (!(var && var->hasAttachedPropertyWrapper ())) {
2363+ (void )getInitializerIsolation (i);
2364+ }
2365+
2366+ // Effects checking for 'async' needs actor isolation to be
2367+ // computed. Always run effects checking after the actor
2368+ // isolation checker.
2369+ evaluateOrDefault (
2370+ getASTContext ().evaluator ,
2371+ CheckInitEffectsRequest{initContext, expr},
2372+ {});
2373+ }
2374+
2375+ return expr;
23522376}
23532377
23542378Expr *PatternBindingDecl::getCheckedAndContextualizedExecutableInit (
0 commit comments