Stream: beginners

Topic: code from tutorial crashes compiler


view this post on Zulip Artur Swiderski (Nov 25 2022 at 23:57):

code:
app "hello"
packages { pf: "/home/arti/roc/examples/cli/cli-platform/main.roc" }
imports [pf.Stdout, pf.Program]
provides [main] to pf

res = returnFoo { foo: "hi!", bar: "blah" }

main =
Stdout.line "hiden number \(res)" |> Program.quick

returnFoo = .foo
output:
thread 'main' panicked at 'internal error: entered unreachable code: symbol/layout 16.IdentId(2) ProcLayout {
arguments: [
Struct {
field_order_hash: FieldOrderHash(
15102965232334018597,
),
field_layouts: [
Builtin(
Str,
),
Builtin(
Str,
),
],
},
],
result: Builtin(
Str,
),
captures_niche: CapturesNiche(
[],
),
} combo must be in DeclarationToIndex', crates/compiler/mono/src/borrow.rs:165:9
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

view this post on Zulip Richard Feldman (Nov 26 2022 at 01:46):

wow, I'm surprised nobody has noticed this until now - thanks for finding it!

view this post on Zulip Richard Feldman (Nov 26 2022 at 01:46):

I've minimized a reproduction and reported it here: https://github.com/roc-lang/roc/issues/4606


Last updated: Jul 05 2025 at 12:14 UTC