summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-02-10 23:26:32 -0500
committerOri Bernstein <ori@eigenstate.org>2014-02-10 23:26:32 -0500
commit68b18a7fba8313ad5b1d8b4c6be61e3b8b126304 (patch)
treea30c41e3637cd99fd50eefbff36cc617718fdb30 /test
parentc158da43321893956e4be405ed04af37f86259fa (diff)
downloadmc-68b18a7fba8313ad5b1d8b4c6be61e3b8b126304.tar.gz
Do some sanitization on traits.
- Remove tctest: all tests now take a boolean. - Rename traits to more sensible names: tcnum => numeric tcint => integral tcfloat => floating tcidx => indexable tcslice => sliceable - Remove duplicate trait setting. We were setting traits twice in some places, adding ones that didn't belong, which was making pointers look indexable.
Diffstat (limited to 'test')
-rw-r--r--test/generictype.myr2
-rw-r--r--test/genericval.myr2
-rw-r--r--test/trait-builtin.myr6
3 files changed, 5 insertions, 5 deletions
diff --git a/test/generictype.myr b/test/generictype.myr
index c19c096..f4046bf 100644
--- a/test/generictype.myr
+++ b/test/generictype.myr
@@ -2,7 +2,7 @@ use std
/* checks that parameterized types work. exits with 0. */
type option(@a) = union
- `Some @a::(tcint,tcnum,tctest)
+ `Some @a::(integral,numeric)
`None
;;
diff --git a/test/genericval.myr b/test/genericval.myr
index c95817b..ca7a925 100644
--- a/test/genericval.myr
+++ b/test/genericval.myr
@@ -1,6 +1,6 @@
use std
-generic Foo : @a::(tctest,tcint,tcnum) = 42
+generic Foo : @a::(integral,numeric) = 42
const main = {
std.exit(Foo)
diff --git a/test/trait-builtin.myr b/test/trait-builtin.myr
index 5df77ce..93c5bda 100644
--- a/test/trait-builtin.myr
+++ b/test/trait-builtin.myr
@@ -1,13 +1,13 @@
use std
/* checks that generic types with traits are compiled correctly.
-without the 'tcnum' trait on '@a', the '>' operator would not work
+without the 'numeric' trait on '@a', the '>' operator would not work
within max. without the 'tctest' trait on '@a' in intlike_is42,
comparing to 42 wouldn't work.
exits with 42.
*/
-generic max = {a:@a::tcnum, b:@a::tcnum
+generic max = {a:@a::numeric, b:@a::numeric
if a > b
-> a
else
@@ -15,7 +15,7 @@ generic max = {a:@a::tcnum, b:@a::tcnum
;;
}
-generic intlike_is42 = {a : @a::(tcnum,tctest,tcint)
+generic intlike_is42 = {a : @a::(numeric,integral)
-> a == 42
}