1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-03 09:41:10 +03:00
juvix/tests/Compilation/negative/test012.juvix
Łukasz Czajka 95275ca5c1
Detect constant side conditions in matches (#3133)
* Closes #3007 
* Depends on #3101 
* Detects side conditions which are `true` (removes the condition) or
`false` (removes the branch).
2024-11-01 09:50:19 +00:00

12 lines
223 B
Plaintext

-- Non-exhaustive pattern matching with false side conditions
module test012;
import Stdlib.Prelude open;
f (x : List Nat) : Nat :=
case x of
| nil := 0
| x :: _ if false := x;
main : Nat := f (1 :: 2 :: nil);