Repository navigation
-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
Conversation
…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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes for the items TSLANG_ISSUES 246 (re-check of 234-245 on pre-alpha146) still lists as open.
--own-factsobject which places of it it reads (name\t@<pos> <type>). An overwrite of another place of that type two modules away (Map.set, anint[]field reassigned) leaves the borrow alone. golden_line_world.ts with itsMap<int, int>caches andthis.bag = orderback: trees.ts and structkit.ts compile.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 everygeoTakereverted.JsonValue.atis notPart.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.SimplifyIndirectCallWithKnownCalleeand the call lowering. saloon.ts's chair-back closure in its loop compiles.@valueclass's throwing..missingstub 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
letthat borrows a local owner can't be reassigned;--own-fallback=countruns 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--classes300 and--deep300 programs: 0 failures.🤖 Generated with Claude Code