in this post I noticed that there's an unreachable branch in a when
:
when err is
IOError _ _ -> "Error reading dir"
there won't be a tag of type IOError
there at that point (in part because we didn't wrap the possible I/O errors in an outer tag to facilitate matching like this; whoops - we should change it from IOError
to [IOError IOError]
), but there's no compiler warning about it.
does anyone know if this is a bug, or if we just don't report unreachable branches like this?
https://github.com/roc-lang/roc/issues/3692
https://github.com/roc-lang/roc/pull/3601 is a super old PR that implements the basic version to do this check
Last updated: Jul 06 2025 at 12:14 UTC