summaryrefslogtreecommitdiff
path: root/test/compoundimpl.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-05-20 22:14:54 -0400
committerOri Bernstein <ori@eigenstate.org>2014-05-20 22:14:54 -0400
commitda52a8bf41174d1483c6094a339be759741df877 (patch)
treeab0ee4674c45982b17df5a34dfa9e8a3892e9e8e /test/compoundimpl.myr
parent8535643bf09a88c6e83727ba0243772703171ca8 (diff)
downloadmc-da52a8bf41174d1483c6094a339be759741df877.tar.gz
Add tests for impls over compound types.
As expected -- it's broken.
Diffstat (limited to 'test/compoundimpl.myr')
-rw-r--r--test/compoundimpl.myr29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/compoundimpl.myr b/test/compoundimpl.myr
new file mode 100644
index 0000000..4c946e2
--- /dev/null
+++ b/test/compoundimpl.myr
@@ -0,0 +1,29 @@
+use std
+
+trait frobable @a =
+ frob : (val : @a -> void)
+;;
+
+impl frobable int# =
+ frob = {val
+ std.put("intptr,")
+ }
+;;
+
+impl frobable char# =
+ frob = {val
+ std.put("charptr\n")
+ }
+;;
+
+generic foo = {x : @a::frobable
+ frob(x)
+}
+
+const main = {
+ var a = 123
+ var b = 'c'
+ foo(&a)
+ foo(&b)
+}
+