summaryrefslogtreecommitdiff
path: root/test/matchptr.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-01-24 23:02:36 -0800
committerOri Bernstein <ori@eigenstate.org>2016-01-24 23:02:36 -0800
commita8935c73459f261ab58b80d4c3936910181813cd (patch)
tree2d922641146264498765ab9b5e1e9a9ec320583d /test/matchptr.myr
parenta0697ff99ca952c46320707b2532bf1459078f56 (diff)
downloadmc-a8935c73459f261ab58b80d4c3936910181813cd.tar.gz
Add pointer match syntax.
Diffstat (limited to 'test/matchptr.myr')
-rw-r--r--test/matchptr.myr13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/matchptr.myr b/test/matchptr.myr
new file mode 100644
index 0000000..f7f2f8b
--- /dev/null
+++ b/test/matchptr.myr
@@ -0,0 +1,13 @@
+use std
+
+const main = {
+ var x : std.option(std.option(int)#)
+
+ x = `std.Some &(`std.Some 123)
+ match x
+ | `std.Some &(`std.None): std.put("failed\n")
+ | `std.Some &(`std.Some 666): std.put("failed\n")
+ | `std.Some &(`std.Some 123): std.put("worked\n")
+ | _: std.put("failed\n")
+ ;;
+}