Skip to content

add binary type checker semantic pass#306

Merged
cs01 merged 3 commits intomainfrom
binary-type-checker
Mar 12, 2026
Merged

add binary type checker semantic pass#306
cs01 merged 3 commits intomainfrom
binary-type-checker

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 12, 2026

Summary

  • New compile-time semantic pass rejects invalid binary operations (e.g., "hi" - 3, true + 8, [1,2] + "x")
  • Catches mismatched types for arithmetic (-, *, /, %, etc.), addition (+), and comparison (<, >, etc.) operators
  • Only checks literal/built-in types (no variable tracking yet) — catches the most obvious errors without self-hosting complexity
  • Test fixtures are @test-skip since native compiler doesn't execute the pass yet

Test plan

  • npm run verify:quick passes (tests + Stage 1 self-hosting)
  • JS compiler correctly rejects true + 8, "hi" - 3, [1,2] + "x"
  • Valid operations (1 + 2, "a" + "b", "count: " + 42) compile fine

🤖 Generated with Claude Code

@cs01 cs01 merged commit 09171e3 into main Mar 12, 2026
12 checks passed
@cs01 cs01 deleted the binary-type-checker branch March 12, 2026 22:38
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