Emit VarStorages eagerly (#7468)

We used to have to batch these at the end of pattern traversal in order
to avoid accidentally adding them to a block that was speculatively
pushed for an expression within a pattern, but that's no longer a
concern with the more precise handling of those speculative blocks in
#7445.
This commit is contained in:
Geoff Romer
2026-07-08 19:33:46 +00:00
committed by GitHub
parent 4261bb2dd2
commit 96c7cfe41c
6 changed files with 77 additions and 93 deletions
@@ -211,10 +211,6 @@ auto HandleParseNode(Context& context, Parse::ForHeaderId node_id) -> bool {
// should be in scope.
context.full_pattern_stack().EndPatternInitializer();
// Create storage for var patterns now.
context.full_pattern_stack().BuildLocalVarStorage(context,
/*is_returned_var=*/false);
// Initialize the pattern from `<element>.Get()`.
auto element_value_id =
CallOptionalAccessor(context, node_id, element_id, CoreIdentifier::Get);