summaryrefslogtreecommitdiff
path: root/test/genericchain.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-06-24 23:54:51 -0400
committerOri Bernstein <ori@eigenstate.org>2014-06-24 23:54:51 -0400
commita0450d9c08d6c0d83c8eb0d04bc382da63b36506 (patch)
treedaa7e525f5cd1e42af6012941c9fa5075f231c1a /test/genericchain.myr
parent70caab3b29189a6878b2a1382100dd18ba0b4ae9 (diff)
downloadmc-a0450d9c08d6c0d83c8eb0d04bc382da63b36506.tar.gz
Add borked test case for generic chaining.
Diffstat (limited to 'test/genericchain.myr')
-rw-r--r--test/genericchain.myr16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/genericchain.myr b/test/genericchain.myr
new file mode 100644
index 0000000..0608cf6
--- /dev/null
+++ b/test/genericchain.myr
@@ -0,0 +1,16 @@
+use std
+
+generic fail = {val : @a
+ -> `std.Some val
+}
+
+generic try = {opt : std.option(@b)
+ match opt
+ | `std.Some v: -> v
+ | `std.None: std.die("Badness\n")
+ ;;
+}
+
+const main = {
+ std.put("val = %i\n", try(fail(123)))
+}