Verify multi-level and diamond extends interface hierarchies work correctly#267
Merged
Merged
Conversation
…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>
4 tasks
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>
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.
Summary
PR #266 fixed casting to an interface that
extendsanother interface with methods, but only verified single-levelextendsand flagged deeper hierarchies as an unverified known limitation (particularly aroundvirtualIndexassignment correctness).Manually verified (both same-module and cross-module):
C extends B extends A), calling inherited methods from all 3 levelsCombined extends Left, Right, siblings not sharing a common ancestor)Diamond extends Left, Rightwhere bothLeftandRightindependentlyextends 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 (
methodsAsFieldspropagation,getAllMethods()) are themselves naturally recursive/multi-target, walking everyextendsheritage entry rather than assuming a single one.Test plan
00object_annotated_method_extends_interface_multilevel.ts(compile + JIT) covers the 3-level-chain and two-extends-targets cases🤖 Generated with Claude Code