Skip to content

fix: replace nested inline type assertions with named ast types#145

Merged
cs01 merged 1 commit intomainfrom
fix-nested-assertions
Mar 9, 2026
Merged

fix: replace nested inline type assertions with named ast types#145
cs01 merged 1 commit intomainfrom
fix-nested-assertions

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 9, 2026

Summary

  • Removed nested inline struct assertions (as { members: { name, value }[] }) from enum methods in llvm-generator.ts — these are native compiler crash risks per CLAUDE.md
  • Replaced nested arrow body assertion (as { statements: { type, value? }[] }) with named BlockStatement/ReturnStatement types
  • Removed unnecessary as casts where types were already correct (ast.enums is EnumDeclaration[])

Notes

  • for...of on this.ast.enums breaks self-hosting (Stage 1 fails with "Method setSourceCode not found") — kept indexed loops. This is a separate native compiler bug worth investigating.

Test plan

  • npm run verify:quick passes (tests + Stage 0 + Stage 1)
  • TypeScript compiles clean

🤖 Generated with Claude Code

…vm-generator

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cs01 cs01 merged commit 3eeb111 into main Mar 9, 2026
12 checks passed
@cs01 cs01 deleted the fix-nested-assertions branch March 12, 2026 05:34
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