summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-08-13 18:17:46 -0700
committerOri Bernstein <ori@eigenstate.org>2017-08-13 18:24:50 -0700
commit433606f675efdaa466b7e9ab8adb257999af5ae6 (patch)
tree2708d45d3f391bed7a99da3bd30502993cd5fdde /test
parent548ce5467e98c95e545be3fd021da014798a942d (diff)
downloadmc-433606f675efdaa466b7e9ab8adb257999af5ae6.tar.gz
If a trait is specialized over a generic, it's generic too.
Diffstat (limited to 'test')
-rw-r--r--test/gtrait.myr15
-rw-r--r--test/tests1
2 files changed, 16 insertions, 0 deletions
diff --git a/test/gtrait.myr b/test/gtrait.myr
new file mode 100644
index 0000000..5131ccc
--- /dev/null
+++ b/test/gtrait.myr
@@ -0,0 +1,15 @@
+use std
+
+trait comparable @a =
+ cmp : (a : @a, b : @a -> std.order)
+;;
+
+impl comparable @a::numeric =
+ cmp = {a, b
+ -> std.numcmp(a, b)
+ }
+;;
+
+const main = {
+ std.put("{}", cmp(1, 2))
+}
diff --git a/test/tests b/test/tests
index fcd058c..07fffaa 100644
--- a/test/tests
+++ b/test/tests
@@ -86,6 +86,7 @@ B multistr E 0
B generic E 42
B genericval E 42
B trait-builtin E 42
+B gtrait P '`std.Before '
B emptytrait E 123
B traitimpl P 246,44,meee
# B compoundimpl P intptr,charptr BUGGERED