Stream: beginners

Topic: Index out of bounds


view this post on Zulip Kiryl Dziamura (Jan 22 2024 at 10:51):

How to debug this comptime error?

index out of bounds: the len is 0 but the index is 0

it's here: https://github.com/roc-lang/roc/blob/e2dac4f022275a6d4645477f7c321bf1ad3dfce7/crates/compiler/mono/src/layout.rs#L3323

but I'm not sure how to identify the problematic pattern so I can fix it in my code

view this post on Zulip Kiryl Dziamura (Jan 22 2024 at 11:12):

Found the problem:

List List [Wall, Empty]

The fix is:

List (List [Wall, Empty])

Going to create an issue for better logging in gh


Last updated: Jul 06 2025 at 12:14 UTC