Skip to content

fix: use getAllInterfaceFields to include inherited fields in interface codegen#114

Merged
cs01 merged 1 commit intomainfrom
fix/interface-inheritance-fields
Mar 8, 2026
Merged

fix: use getAllInterfaceFields to include inherited fields in interface codegen#114
cs01 merged 1 commit intomainfrom
fix/interface-inheritance-fields

Conversation

@cs01
Copy link
Owner

@cs01 cs01 commented Mar 8, 2026

Summary

  • interfaceDef.fields only returns an interface's OWN fields, missing any fields inherited via extends
  • This caused wrong GEP indices and missing metadata keys for any interface that uses inheritance
  • Fixed all codegen sites in member.ts, variable-allocator.ts, interface-allocator.ts, class.ts, and llvm-generator.ts to use getAllInterfaceFields() instead
  • Added getAllInterfaceFields to IGeneratorContext and MemberAccessGeneratorContext so all generators can access it
  • Added tests/fixtures/interfaces/interface-extends.ts to exercise the path

Test plan

  • All 427 existing tests pass (node and native)
  • Self-hosting chain passes (--quick)
  • New fixture interface-extends.ts tests inherited field access

🤖 Generated with Claude Code

@cs01 cs01 merged commit 250b104 into main Mar 8, 2026
12 checks passed
@cs01 cs01 deleted the fix/interface-inheritance-fields branch March 12, 2026 05:35
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