Stream: bugs

Topic: Compiler bug? Unwrapping 'none' value


view this post on Zulip Paul Stanley (Dec 01 2024 at 17:57):

I have an app file which checks without errors or warnings. dev, build or run all produce

thread '<unnamed>' panicked at crates/compiler/mono/src/ir.rs:5927:10: called Option::unwrap() on a None value

I am on roc nightly pre-release, built from commit d72da8eb0fb on Fri Nov 29 09:25:13 UTC 2024, and my Basic-CLI is 0.17.0.

This happens when I attempt to print (either debug or in Stdout.line) a string constructed by a function in a package I am loading locally. The function operates as expected if tested or dbged in the package code itself.

Well above my ability to guess what's happening. Certainly eminently possible that the mistake is mine.

view this post on Zulip Sam Mohr (Dec 01 2024 at 18:21):

Can you drop a repro here?

view this post on Zulip Paul Stanley (Dec 01 2024 at 18:26):

How much do you need? The problem is that it could well be an interaction with the underlying package I'm pulling in. The problem file is https://github.com/PaulStanley/unicode/blob/main/examples/lowercase.roc (But bear in mind this is messy WIP ...)

The stack trace if that helps is

Stacktrace

view this post on Zulip Eli Dowling (Dec 01 2024 at 18:36):

This error is definitely coming from compiling a call to dbg

view this post on Zulip Paul Stanley (Dec 01 2024 at 18:40):

OK. Well, found the problem -- and I think it makes sense. I had left a couple of dbg in the library file, and that was doing it. With those removed, all is good.

This maybe should be an error (or warning) because dbg code shouldn't really stay in library files I guess in production. But ... not the easiest thing to spot!

view this post on Zulip Paul Stanley (Dec 01 2024 at 18:42):

But ... nice to see it working with the famous turkish dotless i (and ... even better really the final sigma ...)

In Turkish    thıs ıs a greek word: σαββατος. and for lìthuanıan

view this post on Zulip Anton (Dec 02 2024 at 10:20):

#7295


Last updated: Jul 06 2025 at 12:14 UTC