Repository navigation
[TS] Stop unsupported accessor and method-value storage access - #595
Open
CaelmBleidd wants to merge 2 commits into
Open
CaelmBleidd wants to merge 2 commits into
CaelmBleidd wants to merge 2 commits into
Conversation
This was referenced Oct 16, 2026
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.
Allocated class-instance reads can currently treat a declared getter as an ordinary storage field and return
undefinedwithout reporting a limitation. The frozen Matrix example reproduces this:new Matrix([[1,2],[3,4]]).get(1,0)reads therowsgetter, producing symbolicundefinedversus native3.EtsIR currently does not distinguish accessor declarations from ordinary prototype methods. A small shared boundary now rejects allocated instance property reads and writes when the runtime class/ancestor declares a same-name method-like member but no real data field. The existing unsupported-path mechanism retains the reason and does not report an engine failure. A previous write does not bypass this boundary: assigning a getter without a setter can throw or be ignored natively, so a modeled write must not fabricate an own property. Ordinary method calls, inherited calls, declared own data fields (including field shadowing), ordinary data-field writes, and callable data fields retain their behavior. Method-value reads and ambiguous method-overwriting assignments conservatively stop.
A narrow grammar proof preserves already supported method-overwriting calls: a TypeScript getter has zero parameters and a setter has one parameter with a void return. More than one parameter, or one parameter with an explicit Boolean/number/string return, proves an ordinary method. Only writes use that exception; unknown/ambiguous signatures remain guarded. The original
CapturedMethodCallssource and assertions are unchanged.Validation: full
:usvm-ts:testpasses with 1786 tests: 1647 passed, 139 skipped, zero failures/errors;detektMain,detektTest, andgit diff --checkpass. The 11 focused tests include the original method-capture controls and source/native accessor boundary tests. Before the guard, the new getter regression failed because analysis returned a state instead of an unsupported result. Native controls distinguish function-valued reads, own data, safe method-capture order, setter effects, and the TypeError from getter assignment inside a class method. Setter writes remain explicitly unsupported instead of discarding their effect.Original frozen sources remain unchanged: Matrix retains 44 methods, stops explicitly on
rowswith zero terminal states and no engine failure; SegmentTree retains 21 methods and its constructor/query still returns one symbolic3, matching native execution with no unsupported paths. This is a safety boundary, not getter execution. General accessor effects, setter execution, and complete method-value semantics remain in #577.Refs #577. Depends on #578.