You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DeclarationPrinter never printed the `abstract` modifier (class- or
method-level) when embedding a class declaration into a compiled binary's
__decls. The reimporting module re-parsed the declaration as a CONCRETE
class, so mlirGenClassNew - which skips `.new` synthesis for abstract
classes - generated a `.new` vtable slot the exporting module never had.
Every base-class slot after `.instanceOf` shifted by one, and the exporting
module's compiled method bodies (with slot indexes baked in) dispatched
`this.<abstractMethod>()` into the wrong slot: a pointer-returning `.new`
called through a double-returning signature, "returning" stale XMM0.
That stale-register garbage is why this hid so well: a directly preceding
`assert(s.area() == 9)` left 9.0 in XMM0, so direct and base-class-cast
calls passed by luck while an interface-path call got 0 - which is why the
disabled test's comment misattributed this to an interface `this`-binding
gap, and why import_class_abstract (2-level chain) appeared to pass.
Fix: print `abstract ` before `class` (layout-relevant: controls `.new`
synthesis) and before abstract method signatures (semantic: the importer
must not treat the exporter's abstract methods as linkable symbols).
Also: re-enable both disabled *-class-implements-interface-abstract tests,
add a deterministic single-level regression pair
(*_class_abstract_virtual_dispatch.ts - describe() twice before any area()
call so register luck can't mask a regression), and add an opt-in
TSLANG_TEST_KEEP_TEMP env var to test-runner so failing tests' artifacts
survive for inspection.
816/816 tests green.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
# DISABLED: see the matching test-compile-shared-export-import-class-implements-interface-abstract comment above (known issue, 2026-07-22, NOT fixed) - the JIT tier of the abstract variant hits the same this.area()-returns-0-via-interface bug.
0 commit comments