diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t9849.check | 7 | ||||
-rw-r--r-- | test/files/neg/t9849.scala | 16 | ||||
-rw-r--r-- | test/files/neg/trait-defaults-super.check | 4 | ||||
-rw-r--r-- | test/files/neg/trait-defaults-super.scala | 21 |
4 files changed, 48 insertions, 0 deletions
diff --git a/test/files/neg/t9849.check b/test/files/neg/t9849.check new file mode 100644 index 0000000000..7b47150846 --- /dev/null +++ b/test/files/neg/t9849.check @@ -0,0 +1,7 @@ +t9849.scala:14: error: method h in object O cannot be accessed in object p.O + O.h() + ^ +t9849.scala:15: error: method h$default$1 in object O cannot be accessed in object p.O + O.h$default$1 + ^ +two errors found diff --git a/test/files/neg/t9849.scala b/test/files/neg/t9849.scala new file mode 100644 index 0000000000..bcd18b6916 --- /dev/null +++ b/test/files/neg/t9849.scala @@ -0,0 +1,16 @@ +package p + +object O { + protected[p] def f(x: Int = 1) = x + private[p] def g(x: Int = 1) = x + private def h(x: Int = 1) = x +} + +object Test { + O.f() + O.f$default$1 + O.g() + O.g$default$1 + O.h() + O.h$default$1 +} diff --git a/test/files/neg/trait-defaults-super.check b/test/files/neg/trait-defaults-super.check new file mode 100644 index 0000000000..2b19402828 --- /dev/null +++ b/test/files/neg/trait-defaults-super.check @@ -0,0 +1,4 @@ +trait-defaults-super.scala:14: error: Unable to implement a super accessor required by trait T unless Iterable[String] is directly extended by class C. +class C extends T + ^ +one error found diff --git a/test/files/neg/trait-defaults-super.scala b/test/files/neg/trait-defaults-super.scala new file mode 100644 index 0000000000..def271e8e7 --- /dev/null +++ b/test/files/neg/trait-defaults-super.scala @@ -0,0 +1,21 @@ +trait T extends java.lang.Iterable[String] { + + override def spliterator(): java.util.Spliterator[String] = { + super[Iterable].spliterator + super.spliterator + null + } + def foo = { + super[Iterable].spliterator + super.spliterator + } + def iterator(): java.util.Iterator[String] = java.util.Collections.emptyList().iterator() +} +class C extends T +object Test { + def main(args: Array[String]): Unit = { + val t: T = new C + t.spliterator + t.foo + } +} |