Stream: compiler development

Topic: unreachable pattern match not reported


view this post on Zulip Richard Feldman (Nov 20 2023 at 22:05):

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.

view this post on Zulip Richard Feldman (Nov 20 2023 at 22:05):

does anyone know if this is a bug, or if we just don't report unreachable branches like this?

view this post on Zulip Ayaz Hafiz (Nov 21 2023 at 00:59):

https://github.com/roc-lang/roc/issues/3692

view this post on Zulip Ayaz Hafiz (Nov 21 2023 at 00:59):

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