Skip to content

Preserve awaited runtime user-class superclass values and inheritance #1967

Description

@nickna

Implement the bounded runtime-superclass representation decided by #1907. Depends on #1964's guest constructor/definition boundary. The original #1849–#1851 note omits its exact source/deadline; new explicit fixtures establish the current mismatch without claiming recovered historical source.

The consolidated #1866 PR will include docs/plans/runtime-valued-superclass.md and tests/fixtures/DynamicSuperclass/. TypeScript 7.0.2 accepts all three final fixtures. Node v25.5.0 and SharpTS interpretation run the selected Right constructor and preserve its instance method, static field, constructor prototype and instanceof identity. On unchanged 0ad37b5 and dced3a75, the compiled positives pass IL verification but ignore the runtime parent; caught missing method/incorrect observer output exits 0. The rejected-heritage control instead fails compilation with a null key exception. The 13 existing known-parent/awaited-heritage/owner tests pass.

Acceptance:

  • Retain evaluated/awaited parent values in fresh guest definitions, validate supported constructors and establish guest constructor/instance prototype links. Preserve static CLR inheritance for checked known parents.
  • Add checked ordinary-user-class constructor/method adapters that initialize/invoke on the original guest child receiver; do not allocate a separate base receiver or invoke an incompatible CLR instance method.
  • Route constructor initialization, inherited instance/static lookup and instanceof through the selected guest parent where runtime heritage applies.
  • Support the fixture's class expression and local declaration forms; null leaf names cannot become dictionary keys. Await/reject heritage before static initialization and preserve original guest errors.
  • Match all three fixtures in both engines and verified standalone output under 30-second limits. Add alternating Left/Right selection, pending suspension, evaluation count/order, own derived field/method, base argument forwarding and super-call receiver controls. Keep the 13 retained known-parent controls and generic/computed regressions passing.
  • Run affected heritage/constructor/prototype/class/state-machine suites, Release, quality gates and actual AOT baseline; separate runtime, IL and hosted evidence.

Stop at ordinary emitted user-class parents with the named fields/constructors/methods/static/prototype behavior. Host/CLR or exotic built-in parents, proxy constructor traps, constructor-return replacement, general mixin typing and new private features remain separate. Do not use guest runtime Reflection.Emit, a compiler dependency, static current-parent state or a guessed leaf-name parent. This finite transfer is not a behavior repair and does not extend frozen #1866.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions