roc icon indicating copy to clipboard operation
roc copied to clipboard

List.concat bug in function

Open FabHof opened this issue 1 month ago • 0 comments

app [main!] { pf: platform "https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/0.5/BJBzo2SR2o5w3StmubGWvnPHq6hfePMaNWy5MwkPuZUs.tar.zst" }

import pf.Stdout

main! = |_| {
    var line = "abc"
    test(line)
    Ok({})
}

test = |line| {
    bytes = line.to_utf8()
    dbg bytes
    foo = List.concat([0], bytes)
    dbg foo
}

output:

dbg: [97, 98, 99]
dbg: [0, 0.000000000006513249, 0, 0]

Strangely inlining the test function results in the expected output.

FabHof avatar Dec 10 '25 17:12 FabHof