roc icon indicating copy to clipboard operation
roc copied to clipboard

Encoding of fractions fails with compiler panic

Open FabHof opened this issue 1 year ago • 0 comments

Code:

...

main =
    enc = 1.2 |> Encode.toBytes json
    ...

error:

thread '<unnamed>' panicked at crates/compiler/mono/src/ir.rs:6143:56:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


There was an unrecoverable error in the Roc compiler. The `roc check` command can sometimes give a more helpful error report than other commands.

Interestingly this works without a problem:

...

main =
    enc = 1.2dec |> Encode.toBytes json
    ...

FabHof avatar Apr 23 '24 18:04 FabHof