@@ -2610,9 +2610,23 @@ namespace {
26102610 return MacroWalking::Expansion;
26112611 }
26122612
2613+ PreWalkResult<Pattern *> walkToPatternPre (Pattern *pattern) override {
2614+ // Walking into patterns leads to nothing good because then we
2615+ // end up visiting the AccessorDecls of a top-level
2616+ // PatternBindingDecl twice.
2617+ return Action::SkipNode (pattern);
2618+ }
2619+
26132620 PreWalkAction walkToDeclPre (Decl *decl) override {
2621+ // Don't walk into local types because nothing in them can
2622+ // change the outcome of our analysis, and we don't want to
2623+ // assume things there have been type checked yet.
2624+ if (isa<TypeDecl>(decl)) {
2625+ return Action::SkipChildren ();
2626+ }
2627+
26142628 if (auto func = dyn_cast<AbstractFunctionDecl>(decl)) {
2615- if (func->isLocalContext ()) {
2629+ if (func->getDeclContext ()-> isLocalContext ()) {
26162630 checkLocalCaptures (func);
26172631 }
26182632
@@ -5355,11 +5369,9 @@ DefaultInitializerIsolation::evaluate(Evaluator &evaluator,
53555369 return ActorIsolation::forUnspecified ();
53565370
53575371 auto i = pbd->getPatternEntryIndexForVarDecl (var);
5358- if (!pbd->isInitializerChecked (i))
5359- TypeChecker::typeCheckPatternBinding (pbd, i);
53605372
53615373 dc = cast<Initializer>(pbd->getInitContext (i));
5362- initExpr = pbd->getInit (i);
5374+ initExpr = pbd->getCheckedAndContextualizedInit (i);
53635375 enclosingIsolation = getActorIsolation (var);
53645376 } else if (auto *param = dyn_cast<ParamDecl>(var)) {
53655377 // If this parameter corresponds to a stored property for a
0 commit comments