summaryrefslogtreecommitdiff
path: root/test/genericret.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2013-09-13 16:54:33 -0400
committerOri Bernstein <ori@eigenstate.org>2013-09-13 16:54:33 -0400
commit076907e11308f988a76dc73fc97641e2ae6b238e (patch)
tree76c88f8e578d090ed7a09f348172ef66f31b6043 /test/genericret.myr
parentb92973e28b8affb30ef3dfe2acf2cc47f95a3e95 (diff)
downloadmc-076907e11308f988a76dc73fc97641e2ae6b238e.tar.gz
Adds test for explicitly instantiated generic type.
Diffstat (limited to 'test/genericret.myr')
-rw-r--r--test/genericret.myr17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/genericret.myr b/test/genericret.myr
new file mode 100644
index 0000000..5c292a7
--- /dev/null
+++ b/test/genericret.myr
@@ -0,0 +1,17 @@
+use std
+
+type t(@a) = union
+ `Val @a
+ `None
+;;
+
+const f = {-> t(int)
+ -> `None
+}
+
+const main = {
+ match f()
+ `None: -> 42;;
+ ;;
+ -> 0
+}