Just messing around with Roc again and I wrote this incorrect code:
main! = |_args| {
a = ["Larry", "Curly", "Moe"]
b = a.swap(0, 2)
echo!("${Str.inspect(b.get(0))}\n")
Ok({})
}
Since b is of type Try, it doesn't make sense to call get on it. When I attempt to run this program with Roc, it appears to enter an infinite loop during type checking. However, if I run this code on the Roc website, it responds with the correct error: This get method is being called on a value whose type doesn't have that method.
Roc compiler version nightly-2026-08-06-61bbb59
I'm not confident enough to know if this needs reporting or not since it works on the website.
Thanks for reading!
Sounds like a bug if its in an infinite loop, a GH issue would be appreciated :smile:
Ok, here it is:
Last updated: Aug 12 2026 at 12:35 UTC