Skip to content

Commit

Permalink
add negative test
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Nov 22, 2024
1 parent 2b4ace5 commit 6e5f02f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/Compilation/Negative.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
]
16 changes: 16 additions & 0 deletions tests/Compilation/negative/test014.juvix
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 6e5f02f

Please sign in to comment.