Skip to content

-mm=own: list walks from a const head and through lending calls; closures calling closures (TSLANG 235, cabLimb) - #1132

Merged
ASDAlexander77 merged 2 commits into
mainfrom
own-walk-const-head-closure-calls
Dec 5, 2026
Merged

ASDAlexander77 merged 2 commits into
mainfrom
own-walk-const-head-closure-calls

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

Fixes the open own items of TSLANG_ISSUES.md: 235 under -mm=own (linked-list cursor walks) and cabLimb (closures in golden_line_cab.ts that call each other). 241 does not reproduce: the own facts come out the same in every compile order.

Walks (TSLANG 235)

  • A let that only borrows may be given a named const's value (const a = new L(0); for (let q: L | null = a; q; q = q.next)). The borrow is bounded by the const's release and by anything that takes the const (borrowedByLocalLets). This applies only to a named const's value; a read of a local's slot is still decided by the slot's receivers.
  • A step through a call that lends its argument back (q = nn(q).next): rc's release of the call's temporary is no longer a keep of what the walking let holds. This only applies to lets that only borrow and are assigned again, so own_err_result_borrows_argument is still refused.

Closures calling closures (cabLimb)

  • A closure read out of the calling closure's own box is a call of it, not a drop.
  • A captured closure that does not escape counts as a fresh fill. followClosure follows a closure stored into another closure's box.

Tests

  • Positive: own_closure_calls_closure, and 00tslang_issue_235_own (gc/rc/own, jit + compile).
  • Refusals: own_err_closure_calls_closure_returned / _stored, and own_err_walk_const_head_cut / _cleared / _moved.
  • docs/own-memory-model.md: two sentences, one on walks and one on closures.

Verified

  • Full ctest: 10566/10566 pass.
  • mm_fuzz --deep and --classes: 300 programs each, 0 failures.
  • native_ts_graphics own-facts chain replay: 0 errors as-is. With the reverted sources, golden_line_cab compiles in its closure form.

🤖 Generated with Claude Code

ASDAlexander77 and others added 2 commits December 5, 2026 14:27
…all that lends its argument back; a closure may call another closure of the same frame (TSLANG 235, cabLimb)

- A `let` that only borrows may be given a named const's value (`const a = new L(0); for (let q: L | null = a; q; q = q.next)`): each assignment borrows the const, bounded by its release and by anything that takes it (borrowedByLocalLets). A const moved, cut or cleared while the walk reads it stays refused.
- A walk stepping through `nn(q).next` no longer counts rc's release of the call's temporary as a keep of what the `let` holds.
- A closure reading a closure it captured out of its own box calls it; a captured closure that does not escape counts as a fresh fill, so `cap` running `frame` then `ring` (golden_line_cab) compiles. A closure that escapes still takes its captures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit e320071 into main Dec 5, 2026
11 of 12 checks passed
@ASDAlexander77
ASDAlexander77 deleted the own-walk-const-head-closure-calls branch December 5, 2026 15:47
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