Skip to content

fix: convert booleans to true/false in string concatenation#242

Merged
cs01 merged 1 commit intomainfrom
fix/string-concat-boolean
Mar 11, 2026
Merged

fix: convert booleans to true/false in string concatenation#242
cs01 merged 1 commit intomainfrom
fix/string-concat-boolean

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 11, 2026

Summary

  • "active: " + true now correctly produces "active: true" instead of "active: 1"
  • Boolean literals, comparison expressions (1 > 0), and negation (!x) are detected in string concatenation and converted to "true"/"false" strings instead of numbers
  • Handles all LLVM boolean types (i1, i64, double)

Test plan

  • New fixture strings/string-concat-boolean.ts tests literal booleans, comparisons, and negation in string concat
  • npm run verify:quick passes (all tests + Stage 1 self-hosting)
  • Both JS and native compilers produce correct output

🤖 Generated with Claude Code

…+ operator

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