Repository navigation
-mm=own: @keeps/@borrows parameter markers and own generator fixes - #622
Merged
Merged
Conversation
- @keeps("p") / @borrows("this","p") declare what a function keeps of, or borrows from, its arguments; they carry across modules through __decls and dynamic imports, and are checked against the body and family overrides. - A narrowed generator local is a view of its state field, not an SSA copy. - Under own, an iterator's next() result and a generator maker's state object are the caller's, even through the Iterator interface or another module. - Another module's generator state is released without its fields. - Yielded state fields are not released by the state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # tslang/lib/TypeScript/OwnershipInferencePass.cpp
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.
Decision B toward an own default library (after #611). Spec:
tslang/docs/superpowers/specs/2026-10-19-own-param-markers-design.md. DefaultLib companion: ASDAlexander77/TypeScriptCompilerDefaultLib#37@keeps("p")/@borrows("this","p")say what a function keeps of, or what its generator state borrows from, its arguments. They are printed into__decls, carried onto dynamic-import globals, and checked: against the body, and across family overrides (errors name the parameters). Unknown, repeated or empty markers are errors.next()is the caller's (user ruling): an iterator'snext()result and a generator maker's state are fresh, through theIteratorinterface or another module; onlynext(), not every unresolved call..capturedbox's cells, and their values unless the maker says@borrows.nextwas confused with a generator's).own/own_param_markers,own_generator_locals,own_iterator_next, sixown_err_*cases, and cross-moduleexport_own_markers/import_own_markers*under gc, rc and own.Merged with main (#618-#621); one conflict in
walkBorrowed, kept the bounded-result exclusion. Full suite: 4813/4813 (Release, Windows, DefaultLib rebuilt for gc/rc/none/own).Not here:
clone().resizetemporary UAF in the own DefaultLib (bug on main);@borrowsfor a non-generator function whose result borrows an argument.🤖 Generated with Claude Code