Idris2/tests/idris2/coverage009/unreachable.idr
Edwin Brady 9970c66417 Warn on detecting unreachable patterns
I don't know how complete this is, but it certainly detects some of the
most obvious cases which are most likely to be bugs.

While I'm at it, this is as good a time as any to add a general way of
reporting warnings, similar to the way of reporting errors.
2020-05-25 00:16:49 +01:00

6 lines
114 B
Idris

foo : Maybe Int -> Bool -> Int
foo Nothing _ = 42
foo Nothing True = 94
foo (Just x) _ = x
foo Nothing False = 42