Skip to content

Verify multi-level and diamond extends interface hierarchies work correctly#267

Merged
ASDAlexander77 merged 1 commit into
mainfrom
test/extends-interface-multilevel-diamond
Jul 20, 2026
Merged

Verify multi-level and diamond extends interface hierarchies work correctly#267
ASDAlexander77 merged 1 commit into
mainfrom
test/extends-interface-multilevel-diamond

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

Summary

PR #266 fixed casting to an interface that extends another interface with methods, but only verified single-level extends and flagged deeper hierarchies as an unverified known limitation (particularly around virtualIndex assignment correctness).

Manually verified (both same-module and cross-module):

  • A 3-level chain (C extends B extends A), calling inherited methods from all 3 levels
  • An interface with two extends targets (Combined extends Left, Right, siblings not sharing a common ancestor)
  • A genuine diamond (Diamond extends Left, Right where both Left and Right independently extends Base)

All cases returned correct values for every inherited member at every level — no further bug found. Makes sense in hindsight: both fixes from #266 (methodsAsFields propagation, getAllMethods()) are themselves naturally recursive/multi-target, walking every extends heritage entry rather than assuming a single one.

Test plan

  • New regression test 00object_annotated_method_extends_interface_multilevel.ts (compile + JIT) covers the 3-level-chain and two-extends-targets cases
  • Full 746-test suite (744 + 2 new): 100% pass, no regressions

🤖 Generated with Claude Code

…rectly

PR #266 fixed casting to an interface that extends another with methods,
but only verified single-level extends (Accumulator extends Base), flagging
deeper hierarchies as an unverified known limitation.

Manually verified (same-module and cross-module): a 3-level chain
(C extends B extends A), an interface with two extends targets
(Combined extends Left, Right), and a genuine diamond (both Left and Right
independently extend Base) - all correct for every inherited member at
every level. No further bug found; both fixes from #266 are themselves
naturally recursive/multi-target, not hardcoded to one level.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ASDAlexander77
ASDAlexander77 merged commit 10c4218 into main Jul 20, 2026
2 checks passed
@ASDAlexander77
ASDAlexander77 deleted the test/extends-interface-multilevel-diamond branch July 20, 2026 18:17
ASDAlexander77 added a commit that referenced this pull request Jul 20, 2026
…268)

interface Combined extends Left, Right (2+ extends targets) had two bugs:
mlirGen(InterfaceDeclaration) re-running for an already-declared interface
duplicated its extends list unboundedly (every other member-add is
idempotent, this push_back wasn't), and the per-object vtable patch loop
used a method's standalone virtualIndex instead of its offset within the
combined vtable, mis-patching every method from the second extends target
onward. Adds cross-module regression coverage for diamond extends (isolated)
and multilevel+diamond together, extending the same-module coverage from
#267 across the module boundary.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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