Skip to content

fix: handle boolean values correctly in template literal interpolation#240

Merged
cs01 merged 1 commit intomainfrom
fix/template-literal-boolean
Mar 11, 2026
Merged

fix: handle boolean values correctly in template literal interpolation#240
cs01 merged 1 commit intomainfrom
fix/template-literal-boolean

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 11, 2026

Summary

  • Template literals like `val=${true}` and `cmp=${1 > 0}` now correctly produce "val=true" and "cmp=true" instead of "val=1" and "cmp=1"
  • booleanToString() now handles all LLVM boolean types (i1, i64, double) instead of assuming double
  • Comparison operators and ! in template interpolation are now detected and routed through boolean-to-string conversion

Test plan

  • New fixture strings/template-literal-boolean.ts tests literal true/false and comparison expressions
  • npm run verify:quick passes (all tests + Stage 1 self-hosting)
  • Both JS and native compilers produce correct output

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cs01 cs01 merged commit 8368719 into main Mar 11, 2026
12 checks passed
@cs01 cs01 deleted the fix/template-literal-boolean 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