roc-lang / roc

A fast, friendly, functional language.
https://roc-lang.org
Universal Permissive License v1.0
3.86k stars 284 forks source link

Roc crashes running `roc test` and `roc check` on a single small file. #6835

Open ashleydavis opened 1 week ago

ashleydavis commented 1 week ago

This crash happens with the latest nightly build: roc_nightly-linux_x86_64-2024-06-22-03eadc2

Was also tested with a nightly build from about a week ago.

Project that demonstrates the issue (branch: roc-issue-6835): https://github.com/ashleydavis/book-of-examples/tree/roc-issue-6835/gallery/roc

The crash happens under Ubuntu/WSL2/Windows 11.

Output from roc check:

$ roc check headings.roc
An internal compiler expectation was broken.
This is definitely a compiler bug.
Please file an issue here: https://github.com/roc-lang/roc/issues/new/choose
thread 'main' panicked at crates/compiler/load_internal/src/file.rs:3292:29:
Outstanding references to the derived module
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Output from roc test:

$roc test headings.roc
thread 'main' panicked at crates/compiler/load_internal/src/file.rs:365:85:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Note that roc test on the whole project just works:

$ roc test
0 failed and 2 passed in 2322 ms.