Skip to content

fix: use getAllInterfaceFields in control-flow.ts for inherited fields#115

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

fix: use getAllInterfaceFields in control-flow.ts for inherited fields#115
cs01 merged 1 commit intomainfrom
fix/control-flow-interface-fields

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 8, 2026

Summary

  • PR fix: use getAllInterfaceFields to include inherited fields in interface codegen #114 fixed getAllInterfaceFields usage in member.ts, variable-allocator.ts, interface-allocator.ts, class.ts, and llvm-generator.ts — but missed control-flow.ts
  • control-flow.ts had 13 sites using direct .fields access on interface objects, missing inherited fields from extends clauses
  • This caused wrong GEP indices and missing metadata for for-of loops, chained member access, union type narrowing, and type guards on interfaces with inheritance
  • Fixed all 13 sites to use this.ctx.getAllInterfaceFields() instead

Test plan

  • All 428 tests pass (includes existing interface-extends fixture + new interface-extends-for-of)
  • New fixture interface-extends-for-of.ts exercises for-of over an array of objects with an inherited interface

🤖 Generated with Claude Code

@cs01 cs01 merged commit 1dccb72 into main Mar 8, 2026
12 checks passed
@cs01 cs01 deleted the fix/control-flow-interface-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