Skip to content

[TS] Construct project instances from runtime constructor values - #466

Open
CaelmBleidd wants to merge 5 commits into
caelmbleidd/ts-457-runtime-instanceoffrom
caelmbleidd/ts-465-runtime-new
Open

CaelmBleidd wants to merge 5 commits into
caelmbleidd/ts-457-runtime-instanceoffrom
caelmbleidd/ts-465-runtime-new

Conversation

@CaelmBleidd

@CaelmBleidd CaelmBleidd commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Dynamic new now consumes JacoDB's evaluated constructor value, resolves its exact project-class identity and allocates that class before executing the existing constructor call. Conditional constructors, returned constructor values, local aliases and argument side effects preserve the selected identity.

Closes #465. This PR is stacked on #464 and requires JacoDB #399; the repository's published JacoDB pin is unchanged.

  • Preserve direct construction and execute the selected constructor exactly once.
  • Read and write common-name fields using the allocated object's runtime class and value sort.
  • Produce terminal TypeError objects for known non-constructable primitives and ordinary project-class instances; report unresolved constructor identity as unsupported.
  • Report field writes that change the selected field's runtime sort as unsupported, including incompatible alternatives of a number|string value. [TS] Support field assignments that change the runtime value sort #467 tracks full support.
  • Check ordinary source behavior through discoverProperties, including both constructor choices and result invariants. The identical-result field-read scenario uses withOptions to collect all states instead of stopping after 100% coverage. Keep the direct API for unsupported outcomes, exception details, stop reasons and generated Node replay cases.

Current head: acb1283d458d979a775dee8818d7ec5d1a29ba0f. Parent: #464 at bab79630bbf10cb08559ce1410cf69c1e3c2601e. The production patch is unchanged by the test-style update and rebase.

On this final head, 12 RuntimeNewTest, 20 parent RuntimeInstanceofTest and 6 TsStringEqualityTest cases passed: 38 tests, zero skips, failures or errors. :usvm-ts:detektTest and git diff --check also passed. Tests include Node replay and used a local composite build against the frozen JacoDB #399 commit b5e10a1a0c5d279492c373caf907f6387fff998f via -PuseLocalJacodb=/private/tmp/jacodb-ts-398-build.

Published CI using an older JacoDB artifact cannot validate the new constructor IR operand. Merge after #464 and the corresponding JacoDB dependency update.

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