summaryrefslogtreecommitdiff
path: root/test/infer-named.myr
diff options
context:
space:
mode:
Diffstat (limited to 'test/infer-named.myr')
-rw-r--r--test/infer-named.myr21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/infer-named.myr b/test/infer-named.myr
new file mode 100644
index 0000000..002cc97
--- /dev/null
+++ b/test/infer-named.myr
@@ -0,0 +1,21 @@
+use std
+
+type u = union
+ `Foo
+ `Bar int
+;;
+
+const f = {v : int -> u
+ -> `Bar v
+}
+
+const main = {
+ var v
+
+ v = f(99)
+ match v
+ `Foo: -> 1;;
+ `Bar x: -> x;;
+ ;;
+ -> 2
+}