roc build panics on valid code (roc check is clean) with:
postcheck invariant violated: LIR lowering expected layouts to match or
differ by an explicit Box edge
We need three files to reproduce:
Foo.roc:
Foo := [
Node(List(Foo.Qux), List(Foo)),
].{
Qux := [Wrap(Box(Str -> Str))]
wrap : { items : List(Foo) } -> Foo
wrap = |args|
Node([], args.items)
}
Bar.roc:
import Foo exposing [Foo]
Bar := [].{
build : List(Str) -> Foo
build = |model|
Foo.wrap(
{
items: [
Foo.Node(
[Foo.Qux.Wrap(Box.box(|_v| "made"))],
model.map(|_s| Foo.Node([], [])),
),
],
},
)
}
main.roc (on the test/fx platform):
app [main!] { pf: platform "../platform/main.roc" }
import pf.Stdout
import Bar
main! = || {
_foo = Bar.build([])
Stdout.line!("done")
}
Tested on NixOS, x86, Roc 317e608ca2.
roc buildpanics on valid code (roc checkis clean) with:We need three files to reproduce:
Foo.roc:Bar.roc:main.roc(on thetest/fxplatform):Tested on NixOS, x86, Roc
317e608ca2.