diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2014-01-21 18:12:01 +0100 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2014-01-21 18:12:01 +0100 |
commit | 947defc36115c24a782184cb154ac05259b40f95 (patch) | |
tree | 08aa29d11f6bbdc29468072ac988e6759cbc448a /test/files/neg/abstract-report2.scala | |
parent | 6d71ae88a221c00ee17660418ed54b986727e3df (diff) | |
download | scala-947defc36115c24a782184cb154ac05259b40f95.tar.gz scala-947defc36115c24a782184cb154ac05259b40f95.tar.bz2 scala-947defc36115c24a782184cb154ac05259b40f95.zip |
Make abstract-report2 test less dependent on std library.
Replace the use of `Ordering` by custom, dummy trait Xyz defined in test's
source.
By not inheriting from Ordering in abstract-report2 we make the test
less dependent on both Scala and Java library. The reason we are less
dependent on Java is because Ordering extends Java's comparator.
This change is motivated by the fact that Java 8 introduced default
method `reversed` to Comparator interface and we get a failure due to
conflicting inheritance:
-abstract-report2.scala:9: error: trait Bippy inherits conflicting members:
- method reversed in trait TraversableOnce of type => List[(T2, String)] and
- method reversed in trait Comparator of type ()java.util.Comparator[T3]
-(Note: this can be resolved by declaring an override in trait Bippy.)
-trait Bippy[T1, T2, T3] extends Collection[T1] with TraversableOnce[(T2, String)] with Ordering[T3]
- ^
Diffstat (limited to 'test/files/neg/abstract-report2.scala')
-rw-r--r-- | test/files/neg/abstract-report2.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/files/neg/abstract-report2.scala b/test/files/neg/abstract-report2.scala index b6327b0766..8825340d4a 100644 --- a/test/files/neg/abstract-report2.scala +++ b/test/files/neg/abstract-report2.scala @@ -6,6 +6,10 @@ class Bar extends Collection[List[_ <: String]] class Baz[T] extends Collection[T] -trait Bippy[T1, T2, T3] extends Collection[T1] with TraversableOnce[(T2, String)] with Ordering[T3] +trait Xyz[T] { + def foo(x: T): Boolean +} + +trait Bippy[T1, T2, T3] extends Collection[T1] with TraversableOnce[(T2, String)] with Xyz[T3] class Dingus extends Bippy[String, Set[Int], List[Int]]
\ No newline at end of file |