diff options
| author | Brian Campbell | 2017-12-05 11:31:02 +0000 |
|---|---|---|
| committer | Brian Campbell | 2017-12-06 17:36:59 +0000 |
| commit | c497bef0d49ec32afae584c63a0cee0730cb90b1 (patch) | |
| tree | 864a5c115090a4a810956303a843e5ce633d3493 /test | |
| parent | 17c518d94e5b2f531de47ee94ca0ceca09051f25 (diff) | |
Add top-level pattern match guards internally
Also fix bug in mono analysis with generated variables
Breaks lots of typechecking tests because it generates unnecessary
equality tests on units (and the tests don't have generic equality),
which I'll fix next.
Diffstat (limited to 'test')
| -rw-r--r-- | test/typecheck/pass/atomcase.sail | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/typecheck/pass/atomcase.sail b/test/typecheck/pass/atomcase.sail new file mode 100644 index 00000000..18840867 --- /dev/null +++ b/test/typecheck/pass/atomcase.sail @@ -0,0 +1,18 @@ +default Order dec + +val extern forall Num 'n, Num 'm. (atom<'n>, atom<'m>) -> bool effect pure eq_atom +overload (deinfix ==) [eq_atom] + +val forall 'n, 'n in {8,16}. [:'n:] -> int effect pure test_fn +val forall 'n, 'n in {8,16}. [:'n:] -> int effect pure test_switch + +function test_fn 8 = 8 +and test_fn 16 = 16 + + +function test_switch n = + switch(n) { + case 8 -> 8 + case 16 -> 16 + } + |
