Skip to content

fix: handle non-double types when converting to i1 for object boolean fields#241

Merged
cs01 merged 1 commit intomainfrom
fix/object-field-boolean-type
Mar 11, 2026
Merged

fix: handle non-double types when converting to i1 for object boolean fields#241
cs01 merged 1 commit intomainfrom
fix/object-field-boolean-type

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Mar 11, 2026

Summary

  • Object literal boolean fields (e.g., { active: true }) could produce invalid LLVM IR when the boolean value was i64 or i1 type instead of double
  • Two fcmp one double instructions in object.ts now properly check the value type first: i1 passes through directly, i64 uses icmp ne, and only double uses fcmp
  • Same class of bug as fix: handle boolean values correctly in template literal interpolation #240 (template literal booleans) — generateBoolean() returns i64, not double

Test plan

  • New fixture objects/object-boolean-field.ts tests boolean fields in object literals
  • npm run verify:quick passes (all tests + Stage 1 self-hosting)

🤖 Generated with Claude Code

… fields

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