roc-lang / roc

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

Compiler Bug `Outstanding references to the derived module` #7127

Open lukewilliamboswell opened 1 day ago

lukewilliamboswell commented 1 day ago

I was trying to make a small repro for another issue when I stumbled across this.

$ roc test example.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:3298:29
module []

fn : Result {} {}
fn = (Ok {})?

expect fn == Ok {}
lukewilliamboswell commented 1 day ago

This also throws the same error...

$ roc check src/Models/Product.roc
module [Product, sampleData]

Product : {
    id : I64,
    name : Str,
    category : Str,
    technology : Str,
    description : Str,
    price : Str,
    discount : Str,
}

sampleData : List Product
sampleData = []

But if I cd into the same folder and then roc check it is fine.

11:28:39 ~/Documents/GitHub/roc-htmx-tailwindcss-demo main $ cd src/Models/
11:30:16 ~/Documents/GitHub/roc-htmx-tailwindcss-demo/src/Models main $ roc check Product.roc
0 errors and 0 warnings found in 27 ms