Stream: beginners

Topic: LLVM error when using roc test with Frac and Num.addChecked


view this post on Zulip Fábio Beirão (May 30 2023 at 12:08):

I am facing these issues (using latest nightly):

thread 'main' panicked at 'LLVM error: Did not get return value from bitcode function "roc_builtins.dec.add_with_overflow"', crates/compiler/gen_llvm/src/llvm/bitcode.rs:36:13

thread 'main' panicked at 'LLVM error: Did not get return value from bitcode function "roc_builtins.dec.sub_with_overflow"', crates/compiler/gen_llvm/src/llvm/bitcode.rs:36:13

I couldn't find mentions of add_with_overflow or sub_with_overflow on github issues. Am I doing something wrong?

I narrowed it down to the sage of Frac versus Num in this signature.

Problematic one:

myAddChecked : (Frac a), (Frac a) -> Result (Frac a) [Overflow]
myAddChecked = \a, b ->
    Num.addChecked a b

Non-problematic one:

myAddChecked : (Int a), (Int a) -> Result (Int a) [Overflow]
myAddChecked = \a, b ->
    Num.addChecked a b

I think this is worth opening a ticket, so I'll do that.

view this post on Zulip Anton (May 30 2023 at 12:19):

Thanks for the report @Fábio Beirão, I've replied in the issue.

view this post on Zulip Fábio Beirão (May 30 2023 at 12:20):

Oh wow, impressive speed :clap:🏻
Just if anyone is interested this is the issue I opened.

view this post on Zulip Fábio Beirão (May 30 2023 at 12:21):

These are the issues I have been running into while trying to implement that Variance example for the roc-examples repo :sweat_smile:

view this post on Zulip Anton (May 30 2023 at 12:55):

Could you check if this also occurs with the nightly from 2023-05-27?

view this post on Zulip Fábio Beirão (May 30 2023 at 12:59):

I'll check, one moment please

view this post on Zulip Fábio Beirão (May 30 2023 at 13:03):

roc --version == roc nightly pre-release, built from commit 62cdcea on Sa 27 Mai 2023 09:06:38 UTC
Same failure

view this post on Zulip Anton (May 30 2023 at 13:09):

Thanks, that rules out PR#5468 being the cause

view this post on Zulip Fábio Beirão (May 30 2023 at 13:11):

Not sure if this is relevant of not but I am running on Windows 10, using WSL 2 with Ubuntu-22.04 :sweat_smile: could that convoluted setup be a root cause, or not at all?

view this post on Zulip Anton (May 30 2023 at 13:14):

I'll give it a try on ubuntu to check

view this post on Zulip Anton (May 30 2023 at 13:16):

I need to head out for a little bit, but I'll check after

view this post on Zulip Anton (May 30 2023 at 14:13):

Yes, this also happens on Ubuntu outside of WSL


Last updated: Jul 06 2025 at 12:14 UTC