roc icon indicating copy to clipboard operation
roc copied to clipboard

Minimal `roc check` compiler bug when `roc build` succeeds

Open drewolson opened this issue 1 year ago • 1 comments

roc check seems to often fail in multi-file projects when run on any file other than main.roc. In these cases, roc build still succeeds. Here's the simplest reproduction I could come up with.

$ tree
.
├── MyStr.roc
└── main.roc

1 directory, 2 files

$ cat MyStr.roc 
module [MyStr]

MyStr : Str

$ cat main.roc 
app [main] {
    pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.15.0/SlwdbJ-3GR7uBWQo6zlmYWNYOxnvo8r6YABXD-45UOw.tar.br",
}

import pf.Stdout
import MyStr exposing [MyStr]

greeting : MyStr
greeting =
    "hello"

main : Task {} _
main =
    Stdout.line! greeting

$ roc run
hello

$ roc check MyStr.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>
Outstanding references to the derived module
Location: crates/compiler/load_internal/src/file.rs:3299:29

drewolson avatar Oct 20 '24 22:10 drewolson

Linking to some very similar issues #7127 #7074 #6835

Anton-4 avatar Oct 22 '24 09:10 Anton-4