diff options
author | Martin Odersky <odersky@gmail.com> | 2016-05-19 17:15:51 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-05-19 17:15:57 +0200 |
commit | 77642b925cdea436755ce6e26e794e48c37b3b1a (patch) | |
tree | 2f5ede1459b07d30f18cc4ed20e4fa36289eb3b4 /tests/pos/chan.scala | |
parent | c87c0303e40ef7e0103b2606c744bc7a2b61ece4 (diff) | |
download | dotty-77642b925cdea436755ce6e26e794e48c37b3b1a.tar.gz dotty-77642b925cdea436755ce6e26e794e48c37b3b1a.tar.bz2 dotty-77642b925cdea436755ce6e26e794e48c37b3b1a.zip |
Two more tests
Unrelated to other commits but useful to get in.
Diffstat (limited to 'tests/pos/chan.scala')
-rw-r--r-- | tests/pos/chan.scala | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/pos/chan.scala b/tests/pos/chan.scala new file mode 100644 index 000000000..ea8eb2b54 --- /dev/null +++ b/tests/pos/chan.scala @@ -0,0 +1,20 @@ +trait Comparator { + type T // abstract type member, to be filled in by concrete classes + def ordering: Ordering[T] + def compare(a: T, b: T): Int = ordering.compare(a, b) +} + +object IntComparator extends Comparator { + type T = Int + def ordering: Ordering[Int] = Ordering.Int +} +object Test { + def process(c: Comparator)(items: Seq[c.T]): Int = { + c.compare(items(0), items(1)) + } +} +class Processor[K](c: Comparator { type T = K }) { + def process(items: Seq[K]): Int = { + c.compare(items(0), items(1)) + } +} |