diff --git a/test/Compilation/Negative.hs b/test/Compilation/Negative.hs index f0def9172f..a860e46541 100644 --- a/test/Compilation/Negative.hs +++ b/test/Compilation/Negative.hs @@ -81,5 +81,9 @@ tests = NegTest "Test013: Redundant side condition detection" $(mkRelDir ".") - $(mkRelFile "test013.juvix") + $(mkRelFile "test013.juvix"), + NegTest + "Test014: Non-exhaustive left-hand side pattern" + $(mkRelDir ".") + $(mkRelFile "test014.juvix") ] diff --git a/tests/Compilation/negative/test014.juvix b/tests/Compilation/negative/test014.juvix new file mode 100644 index 0000000000..13f962a086 --- /dev/null +++ b/tests/Compilation/negative/test014.juvix @@ -0,0 +1,16 @@ +-- Non-exhaustive left-hand side pattern +module test014; + +import Stdlib.Data.Nat open; + +type Tree A := + | Leaf + | Node A (Tree A) (Tree A); + +t : Tree Nat := + Node 1 Leaf Leaf; + +main : Nat := + let + (Node x _ _) := t + in x;