Skip to content

e_call: func is neither closure nor lambda #9054

@JRI98

Description

@JRI98
./zig-out/bin/roc file.roc
app [main!] { pf: platform "https://github.com/lukewilliamboswell/roc-platform-template-zig/releases/download/0.6/2BfGn4M9uWJNhDVeMghGeXNVDFijMfPsmmVeo6M4QjKX.tar.zst" }

compress : List(a) -> List(a) where [a.is_eq : a, a -> Bool]
compress = |l| {
    match l {
        [] => []
        [e] => [e]
        [e1, e2, .. as rest] => {
            rest_compression = compress(List.concat([e2], rest))
            if e1 == e2 { rest_compression } else { List.concat([e1], rest_compression) }
        }
    }
}

main! = |_| {
    _a = compress([1, 2])
    Ok({})
}
Roc crashed: e_call: func is neither closure nor lambda

Note: removing the function type annotation avoids this issue.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions