Isn't this a limitation of nimvm instead of a bug? Unless error pragmas were
special cased.
The why for this bug is relatively simple. It's cause the `nimVm` when
statement does not cull the other branches until later and as such evaluates
them, so any compiler magic can run inside. Comically enough that means the
following also incorrectly runs the else branch and echoes.
Please file a bug report.
It works:
template gen_str_in_ct_0: string =
when nimvm:
"sisix dev"
else:
"monkeys"
const a = gen_str_in_ct_0()
assert a == "sisix dev"
assert gen_str_in_ct_0() == "monkeys"
Run
But it fails:
template gen_str_i