diff options
| author | Brian Campbell | 2018-02-22 17:04:20 +0000 |
|---|---|---|
| committer | Brian Campbell | 2018-02-22 17:04:58 +0000 |
| commit | 2c5d36351779c6c85b65f4896148060aeb7faa7c (patch) | |
| tree | 03b458fd5a7c1df440a6d73524309a6bc8fd853a /test/mono/varmatch.sail | |
| parent | d2825f37136128f5ac92127020a4b4a58bce3636 (diff) | |
Start resurrecting monomorphisation tests
Diffstat (limited to 'test/mono/varmatch.sail')
| -rw-r--r-- | test/mono/varmatch.sail | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/test/mono/varmatch.sail b/test/mono/varmatch.sail index 7d2b9b73..279c16be 100644 --- a/test/mono/varmatch.sail +++ b/test/mono/varmatch.sail @@ -1,16 +1,21 @@ -(* Check that when we case split on a variable that the constant propagation - handles the default case correctly. *) +val operator & = "and_bool" : (bool, bool) -> bool +val operator == = {ocaml: "(fun (x, y) -> x = y)", lem: "eq"} : forall ('a : Type). ('a, 'a) -> bool -typedef AnEnum = enumerate { One; Two; Three } +/* Check that when we case split on a variable that the constant propagation + handles the default case correctly. */ -function AnEnum foo((AnEnum) x) = { - switch (x) { - case One -> Two - case y -> y +enum AnEnum = One | Two | Three + +val foo : AnEnum -> AnEnum + +function foo(x) = { + match (x) { + One => Two, + y => y } } -val unit -> bool effect pure run +val run : unit -> bool function run () = { foo(One) == Two & |
