summaryrefslogtreecommitdiff
path: root/test/traitimpl.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-02-20 22:58:17 -0500
committerOri Bernstein <ori@eigenstate.org>2014-02-20 22:58:17 -0500
commitbf18e66ef2986eb84e884297404c38da668ab7a2 (patch)
tree7a9ff450779a0e3a3a7f6a1e3d1facf4d5d5b236 /test/traitimpl.myr
parent1efff8a755b22b20bec7c671c25a63825cfd90f1 (diff)
downloadmc-bf18e66ef2986eb84e884297404c38da668ab7a2.tar.gz
Make the traitimpl test cover more ground.
Diffstat (limited to 'test/traitimpl.myr')
-rw-r--r--test/traitimpl.myr11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/traitimpl.myr b/test/traitimpl.myr
index 5d32d05..4e0d617 100644
--- a/test/traitimpl.myr
+++ b/test/traitimpl.myr
@@ -10,11 +10,20 @@ impl frobable int =
}
;;
+impl frobable int16 =
+ frob = {val
+ -> val * 4
+ }
+;;
+
generic foo = {x : @a::frobable
-> frob(x)
}
const main = {
- std.exit(foo(12))
+ var a, b
+ a = foo(123)
+ b = foo(11 castto(int16))
+ std.put("%i,%w\n", a, b)
}