roc-lang / roc

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

Build error: I thought a non-nullable-unwrapped variant for a lambda set was impossible #6252

Open JRI98 opened 11 months ago

JRI98 commented 11 months ago

The following program, which I tried to simplify the best I could, fails to build with error:

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>
I thought a non-nullable-unwrapped variant for a lambda set was impossible: how could such a lambda set be created without a base case?
Location: crates/compiler/mono/src/layout.rs:1706:61
app [main] { pf: platform "https://github.com/roc-lang/basic-cli/releases/download/0.16.0/O00IPk-Krg_diNS2dVWlI0ZQP794Vctxzv0ha96mK0E.tar.br" }

f = \list ->
    _ = f! list
    Task.ok {}

main =
    f []
Anton-4 commented 2 months ago

Ian McLerran was able to find another minimal reproduction:

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

main = Task.loop {} \{} -> Task.ok (Step (main!))

More context