Lower if/else expressions #83

Open
opened 2026-10-04 02:37:23 +00:00 by jacksonopp · 0 comments
Owner

Depends on #4.

Lower if/else using Cranelift basic blocks and branches.

Twill's if/else is a value-producing expression (it has a type), not just a statement - so this needs a merge block that carries the taken branch's value forward as a block parameter, not just two blocks with no shared result. Cover both the with-else and without-else (implicit Unit) forms.

Depends on #4. Lower `if`/`else` using Cranelift basic blocks and branches. Twill's `if`/`else` is a value-producing expression (it has a type), not just a statement - so this needs a merge block that carries the taken branch's value forward as a block parameter, not just two blocks with no shared result. Cover both the with-`else` and without-`else` (implicit `Unit`) forms.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jacksonopp/twill#83
No description provided.