Repository navigation
[TS] Preserve lexical constructor and field initializer dispatch - #529
Open
CaelmBleidd wants to merge 3 commits into
Open
CaelmBleidd wants to merge 3 commits into
CaelmBleidd wants to merge 3 commits into
Conversation
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.
Direct
super(...)calls on symbolic entry receivers could redispatch to the derived constructor and recurse indefinitely. Instance field initialization had the same virtual-dispatch problem:%instInitcould run the derived initializer in place of a superclass initializer.Resolve uncaptured constructor and
%instInitcalls against their declared owner before receiver-type dispatch. A missing or ambiguous declared target now reaches the existing unknown-call dispatcher once rather than falling through to the derived constructor. Missing owners retainRECEIVER_CLASS_NOT_FOUND, preserving Error/TypeError model and compatibility contracts; a present owner without a unique initializer usesVIRTUAL_METHOD_NOT_FOUND. Captured ordinary.constructor()calls retain their normal callable-property behavior. Dynamicnewuses the exact class already selected at its allocation, including union/any inferred results. Allocation provenance is checked across generated argument temporaries and control-flow joins; an unresolvedsuper(this)target still cannot fall back to the child constructor.Validation:
RuntimeNewTest(18) andSuperConstructorCall(7) cover dynamic aliases/unions, constructor selection before argument effects, exactly-once calls, and missing-owner superclass dispatch.BuiltinOwnerBoundaryTest(5) andStaticOverloads(7).:usvm-ts:detektMain,:usvm-ts:detektTest, andgit diff --checkpass.The missing-owner regression uses an ambient superclass declaration excluded from the executable scene. This covers the unresolved-owner dispatch mechanism; it does not add support for native
Errorsubclassing, which the current frontend already rejects explicitly. A separate existing defect with shadowed inherited field declarations was discovered and retained as a failing reproduction, outside this dispatch fix.No JacoDB dependency change is required. Full module suites and the 200-class campaign are left to CI and the combined integration run.