Skip to content

-mm=own: own facts for fresh results, result places and private functions; ORC virtual-call candidates; named call results; internal throwing stubs (TSLANG 236-246) - #1131

Merged
ASDAlexander77 merged 1 commit into
mainfrom
own-facts-246
Dec 5, 2026
Merged

ASDAlexander77 merged 1 commit into
mainfrom
own-facts-246

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

Fixes for the items TSLANG_ISSUES 246 (re-check of 234-245 on pre-alpha146) still lists as open.

  • 236 (real module): a result that borrows one argument now says in the --own-facts object which places of it it reads (name\t@<pos> <type>). An overwrite of another place of that type two modules away (Map.set, an int[] field reassigned) leaves the borrow alone. golden_line_world.ts with its Map<int, int> caches and this.bag = order back: trees.ts and structkit.ts compile.
  • 240 (real module): a function that may free anything still says its result is fresh (name\tany\tfresh), and private functions whose declarations an importer re-parses say so (name\tlocal\tfresh, which never shadows an exported line). ORC's closed world no longer turns off on golden_line_extrude's declarations: traingeo.ts compiles with every geoTake reverted.
  • ORC, virtual calls: a virtual call names an unclassified method only when that method's class is on the receiver's chain (JsonValue.at is not Part.at). Taken as one, the call's owned result became a borrow that leaked, and golden_line_loco.ts was refused once the closed world held.
  • 238 (loop form): the "named const" mark of a call result survives SimplifyIndirectCallWithKnownCallee and the call lowering. saloon.ts's chair-back closure in its loop compiles.
  • 245: rc's release of a merge of borrowing calls is bookkeeping, not a keeper. The refusals for mixed, stored and after-reset cases stay.
  • 243: a @value class's throwing ..missing stub has internal linkage, so two objects that both make one link.

The whole native_ts_graphics own-facts chain (101 modules) was replayed in a scratch folder with this build: 0 errors as-is. With the 236/238/240 workarounds reverted, world, trees, structkit, traingeo, loco, wheels, saloon and shots compile.

Not fixed here: 241 (not reproduced), 235 under own (a let that borrows a local owner can't be reassigned; --own-fallback=count runs it), cabLimb's closures (closures that capture each other count as escaping).

Tests: test-own-facts-246 (own and gc, two objects), test-own-facts-246-virtual (real default library, mimalloc stats show no leak), 00tslang_issue_245, 00tslang_issue_246_named_call, own_err_merged_borrowing_calls_reset. Full ctest: 10550/10550 locally. mm_fuzz --classes 300 and --deep 300 programs: 0 failures.

🤖 Generated with Claude Code

…thing, result places and private functions; named call results survive the canonicalizer; throwing stubs stay internal (TSLANG 236-246)

- 236: a result that borrows one argument says in the facts which places of it it reads
  (`name\t@<pos> <type>`), so an overwrite of another place of that type two modules away
  (Map.set, an int[] field reassigned) leaves the borrow alone.
- 240: a function that may free anything still says its result is fresh (`name\tany\tfresh`),
  and private functions whose declarations an importer re-parses say so too
  (`name\tlocal\tfresh`, never shadowing an exported line); ORC's closed world no longer
  turns off on them.
- ORC: a virtual call names an unclassified method only when that method's class is on the
  receiver's chain (JsonValue.at is not Part.at); taken as one, the call's owned result became
  a borrow and leaked (golden_line_loco.ts once the closed world held).
- 238: the "named const" mark of a call result survives SimplifyIndirectCallWithKnownCallee and
  the call lowering (OWNED_RESULT_NAMED_CALL_ATTR_NAME).
- 245: rc's release of a merge of borrowing calls is bookkeeping, not a keeper.
- 243: a @value class's throwing `..missing` stub has internal linkage, so two objects link.

Tests: own-facts-246 (own and gc, two objects), own-facts-246-virtual (mimalloc stats show no
leak), 00tslang_issue_245, 00tslang_issue_246_named_call, own_err_merged_borrowing_calls_reset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit d10857b into main Dec 5, 2026
8 checks passed
@ASDAlexander77
ASDAlexander77 deleted the own-facts-246 branch December 5, 2026 13:10
ASDAlexander77 added a commit to ASDAlexander77/native_ts_graphics that referenced this pull request Dec 5, 2026
pre-alpha147 brings the -mm=own fixes for TSLANG 235-246 (ASDAlexander77/TypeScriptCompiler#1131, #1132)
and reports a private or protected member used outside its class as one error, in tsc's words (#1133).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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