Does/should a single line if
work in the repl?
What am I doing wrong?
» if True then "a" else "b"
thread 'main' panicked at 'invalid cond_layout: Erroneous', crates/compiler/mono/src/ir.rs:6637:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
you need Bool.true
for technical reasons
@Folkert de Vries
I kind of knew Bool.true but was a thing but was thrown off because True seemed to be a value... but it makes sense that I'm just defining a new tag on the fly named True.
Thanks!
3 messages were moved here from #beginners > Is Infinity or NaN by Richard Feldman.
oh we should totally give a special-cased error for this!
people coming from Elm or Python likely expect it to be True
and False
I wrote up an issue: #5318
Last updated: Jul 06 2025 at 12:14 UTC