Open Anton-4 opened 3 months ago
Analysis from @smores56:
The issue seems to be coming from returning a value in the REPL that is a lambda/function. When I debug print running \x -> x in the REPL, I get this:
[smores@smoresbook:~/dev/roc]$ cargo run --bin roc -- repl
Finished dev [unoptimized + debuginfo] target(s) in 0.23s
Running `target/debug/roc repl`
The rockin' roc repl
────────────────────────
Enter an expression, or :help, or :q to quit.
» \x -> x
[crates/compiler/gen_dev/src/generic64/mod.rs:1085:9] (dst, &fn_name, &args, &arg_layouts) = (
`#UserApp.setjmp`,
"roc_setjmp",
[
`#UserApp.buffer`,
],
[
InLayout(U64),
],
)
[crates/compiler/gen_dev/src/generic64/mod.rs:1085:9] (dst, &fn_name, &args, &arg_layouts) = (
`#UserApp.result`,
"#UserApp_replOutput_13093313482219921989",
[],
[
InLayout(VOID),
],
)
thread 'main' panicked at crates/compiler/gen_dev/src/generic64/mod.rs:1086:9:
assertion `left == right` failed
left: 0
right: 1
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Which shows that the result we try to store our REPL output into has zero args, but a single arg layout InLayout(VOID)
The above issue is not the case for functions that are called, like (\x -> x) 123, or values, like 123
All fail apparently in the same way: