I'm running into an issue where Num.div
sometimes crashes the compiler if passed numbers with inferred types of Num *
1 / 4
returns a float.
1 / 200
crashes the compiler.
Performing the same 1/200 operation on two numbers that have been manually annotated as Num *
produces a type error.
Not sure what the intended behavior is here.
I'm working on submitting an issue, but first wanted to make sure this wasn't a known issue and that I'm not misunderstanding how things are supposed to work
I don’t think this is a known issue. Definitely sounds like a serious problem, thanks for filing a report!
e.g.
num1 : Num *
num1 = 1
num2 : Num *
num2 = 200
num1 / num2
produces 0.005 : Float a
(Should that be a Float *
?)
I'll finish up the report and update the topic with the issue #
https://github.com/roc-lang/roc/issues/4047
Last updated: Jul 06 2025 at 12:14 UTC