summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-01-01 21:09:50 -0800
committerOri Bernstein <ori@eigenstate.org>2018-01-11 22:16:11 -0800
commit90e26e0f687da28530b3b967df0cedf20407c071 (patch)
tree09c85ff396a5f235dbcbd5db2df911b5217bb472 /test
parent94448201527e0c47c2924219bf1a8d0c0c2406b7 (diff)
downloadmc-90e26e0f687da28530b3b967df0cedf20407c071.tar.gz
Move to new trait syntax.
Diffstat (limited to 'test')
-rw-r--r--test/emptytrait.myr2
-rw-r--r--test/generictype.myr4
-rw-r--r--test/genericval.myr2
-rw-r--r--test/gtrait.myr2
-rw-r--r--test/recgeneric.myr2
-rw-r--r--test/trait-builtin.myr4
-rw-r--r--test/traitimpl.myr2
7 files changed, 9 insertions, 9 deletions
diff --git a/test/emptytrait.myr b/test/emptytrait.myr
index e3c3c91..f4a1f38 100644
--- a/test/emptytrait.myr
+++ b/test/emptytrait.myr
@@ -6,7 +6,7 @@ trait fooable @a =
impl fooable int =
;;
-generic foo = {x : @a::fooable
+generic foo = {x : @a::fooable @a
-> x
}
diff --git a/test/generictype.myr b/test/generictype.myr
index 68a6508..3e62af4 100644
--- a/test/generictype.myr
+++ b/test/generictype.myr
@@ -1,8 +1,8 @@
use std
/* checks that parameterized types work. exits with 0. */
-type option(@a::(integral,numeric)) = union
- `Some @a::(integral,numeric)
+type option(@a) :: integral,numeric @a = union
+ `Some @a
`None
;;
diff --git a/test/genericval.myr b/test/genericval.myr
index ca7a925..fbe2038 100644
--- a/test/genericval.myr
+++ b/test/genericval.myr
@@ -1,6 +1,6 @@
use std
-generic Foo : @a::(integral,numeric) = 42
+generic Foo : @a = 42 :: integral,numeric @a
const main = {
std.exit(Foo)
diff --git a/test/gtrait.myr b/test/gtrait.myr
index 5131ccc..9d84b45 100644
--- a/test/gtrait.myr
+++ b/test/gtrait.myr
@@ -4,7 +4,7 @@ trait comparable @a =
cmp : (a : @a, b : @a -> std.order)
;;
-impl comparable @a::numeric =
+impl comparable @a :: numeric @a =
cmp = {a, b
-> std.numcmp(a, b)
}
diff --git a/test/recgeneric.myr b/test/recgeneric.myr
index 28b9fab..ac5f13b 100644
--- a/test/recgeneric.myr
+++ b/test/recgeneric.myr
@@ -1,6 +1,6 @@
use std
-type o(@a::integral) = union
+type o(@a) :: integral @a = union
`S @a
;;
diff --git a/test/trait-builtin.myr b/test/trait-builtin.myr
index 93c5bda..cdb8735 100644
--- a/test/trait-builtin.myr
+++ b/test/trait-builtin.myr
@@ -7,7 +7,7 @@ comparing to 42 wouldn't work.
exits with 42.
*/
-generic max = {a:@a::numeric, b:@a::numeric
+generic max = {a : @a, b : @a :: numeric @a
if a > b
-> a
else
@@ -15,7 +15,7 @@ generic max = {a:@a::numeric, b:@a::numeric
;;
}
-generic intlike_is42 = {a : @a::(numeric,integral)
+generic intlike_is42 = {a : @a :: numeric,integral @a
-> a == 42
}
diff --git a/test/traitimpl.myr b/test/traitimpl.myr
index e0d1eca..c3293c1 100644
--- a/test/traitimpl.myr
+++ b/test/traitimpl.myr
@@ -22,7 +22,7 @@ impl frobable byte[:] =
}
;;
-generic foo = {x : @a::frobable
+generic foo = {x : @a :: frobable @a
-> frob(x)
}