@@ -585,6 +585,43 @@ const PatternBindingEntry *PatternBindingEntryRequest::evaluate(
585585 return &pbe;
586586}
587587
588+ Expr *PatternBindingCheckedExecutableInitRequest::evaluate (
589+ Evaluator &eval, PatternBindingDecl *binding, unsigned i) const {
590+ // Force the entry to be checked.
591+ (void )binding->getCheckedPatternBindingEntry (i);
592+ if (binding->isInvalid ())
593+ return nullptr ;
594+
595+ if (!binding->isInitialized (i))
596+ return nullptr ;
597+
598+ if (!binding->isInitializerChecked (i))
599+ TypeChecker::typeCheckPatternBinding (binding, i);
600+
601+ if (binding->isInvalid ())
602+ return nullptr ;
603+
604+ // If we entered an initializer context, contextualize any auto-closures we
605+ // might have created. Note that we don't contextualize the initializer for a
606+ // property with a wrapper, because the initializer will have been subsumed by
607+ // the backing storage property.
608+ auto *init = binding->getInit (i);
609+
610+ if (!binding->getDeclContext ()->isLocalContext () &&
611+ !(binding->getSingleVar () &&
612+ binding->getSingleVar ()->hasAttachedPropertyWrapper ())) {
613+ auto *initContext =
614+ cast_or_null<PatternBindingInitializer>(binding->getInitContext (i));
615+ if (initContext) {
616+ TypeChecker::contextualizeInitializer (initContext, init);
617+ (void )binding->getInitializerIsolation (i);
618+ TypeChecker::checkInitializerEffects (initContext, init);
619+ }
620+ }
621+
622+ return binding->getExecutableInit (i);
623+ }
624+
588625bool
589626IsGetterMutatingRequest::evaluate (Evaluator &evaluator,
590627 AbstractStorageDecl *storage) const {
0 commit comments