Skip to content

#2351: an owned List a match consumed is dropped when the pattern takes nothing out; D119 step-2 gate fixture - #2357

Merged
ehartford merged 2 commits into
mainfrom
gaps-2
Oct 12, 2026
Merged

ehartford merged 2 commits into
mainfrom
gaps-2

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

One commit on a31a7df52.

  • D115: match move xs on a List parameter whose pattern takes nothing out leaks the List ([..] => 1) #2351: lower_slice_pattern_take_list (and the array twin) moves what a pattern leaves in an owned subject (a bare .., or nothing after []) into a statement temporary, so it dies at the statement's end (§2.4) instead of being dropped by nobody; the move is logged, so a failed guard restores it. Fixture test/debug_alloc/da_2351_match_move_subject_dropped.w (both repro shapes and the canonical [h, ..t] recursion, leak-free).
  • D119 step 2 gate: test/debug_alloc/da_d119_literal_no_heap.w pins the ruling's allocation count (a never-grown literal in a function called a thousand times costs the program's three baseline allocations).

Gate green; battery pending.

…es nothing out or leaves a bare .. remainder (a statement temporary, §2.4); D119 step 2 gate fixture (a never-grown literal costs the three baseline allocations over a thousand calls)
…the views and fixed-array lowerings leave the subject as it was
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery 3 green on c27b5a14c (gate, uat, battery-checks all rc=0; out/battery/status.txt: green). Batteries 1 and 2 were red only on behav_d115_owned_array: the #2351 block had been pasted into all three slice-pattern lowerings; it now lives in the List lowering alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant