Stream: bugs

Topic: List.fold_rev static dispatch panics


view this post on Zulip Matthieu Pizenberg (Dec 10 2025 at 14:32):

The following usage of fold_rev with static dispatch panics. But if I call it qualified List.fold_rev(...) then it works.

main! = || {
    Stdout.line!("Start reverse")
    _rev =
        [1].fold_rev([], |d, acc| {
            acc.append(d)
        })
    Stdout.line!("Done")
}

When building in debug, I get the following panic:

❯ roc test/fx/fold_rev.roc
Start reverse
thread 976374 panic: reached unreachable code
???:?:?: 0x1024a7077 in ??? (fold_rev.roc)
???:?:?: 0x1024ae063 in ??? (fold_rev.roc)
???:?:?: 0x102584d03 in ??? (fold_rev.roc)
???:?:?: 0x102508517 in ??? (fold_rev.roc)
???:?:?: 0x1024cb94f in ??? (fold_rev.roc)
???:?:?: 0x1024a0f5f in ??? (fold_rev.roc)
???:?:?: 0x10249e76f in ??? (fold_rev.roc)
???:?:?: 0x10249e1d7 in ??? (fold_rev.roc)
???:?:?: 0x10249e13b in ??? (fold_rev.roc)
???:?:?: 0x102403ec7 in ??? (fold_rev.roc)
???:?:?: 0x181ddab97 in ??? (???)
???:?:?: 0x0 in ??? (???)

When building in ReleaseFast, it just freezes indefinitely.

view this post on Zulip Matthieu Pizenberg (Dec 10 2025 at 14:33):

I opened an issue for it: https://github.com/roc-lang/roc/issues/8616

view this post on Zulip Richard Feldman (Dec 10 2025 at 19:03):

fixed in https://github.com/roc-lang/roc/pull/8620


Last updated: Dec 21 2025 at 12:15 UTC