8000
-
String
-"5" is accepted, and fails at run time.
-"5"
main do IO.printLine(-"5") end
kex -C
No errors found.
kex -R
runtime error: cannot negate String
kex
Internal error: badarith
Expected: KEXET-0420 (unary '-' requires a number, got String), which exists for this case but is not reported.
unary '-' requires a number, got String
Seen on kex 0.4.0-rc.4 built from main at 371bbdf, and on 5773911. Found while writing explanations for oops.kex.run.
The same happens for a Bool:
Bool
main do let flag = true IO.printLine(-flag) end
kex -C: No errors found. Then runtime error: cannot negate Bool on the walker, and Internal error: badarith on BEAM. Checked on main at 371bbdf.
runtime error: cannot negate Bool
Activity
akoskovacs commentedon Nov 22, 2026
The same happens for a
Bool:kex -C:No errors found.Thenruntime error: cannot negate Boolon the walker, andInternal error: badarithon BEAM. Checked on main at 371bbdf.