diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/t4283b.check | 4 | ||||
-rw-r--r-- | test/files/neg/t4283b/AbstractFoo.java | 5 | ||||
-rw-r--r-- | test/files/neg/t4283b/ScalaBipp.scala (renamed from test/pending/run/t4283/ScalaBipp.scala) | 0 | ||||
-rw-r--r-- | test/files/neg/t4283b/Test.scala | 3 | ||||
-rw-r--r-- | test/files/run/t4283.check | 5 | ||||
-rw-r--r-- | test/files/run/t4283/AbstractFoo.java (renamed from test/pending/run/t4283/AbstractFoo.java) | 0 | ||||
-rw-r--r-- | test/files/run/t4283/ScalaBipp.scala | 5 | ||||
-rw-r--r-- | test/files/run/t4283/Test.scala (renamed from test/pending/run/t4283/IllegalAccess.scala) | 5 | ||||
-rw-r--r-- | test/files/run/t5162.scala | 19 |
9 files changed, 43 insertions, 3 deletions
diff --git a/test/files/neg/t4283b.check b/test/files/neg/t4283b.check new file mode 100644 index 0000000000..30d03a310d --- /dev/null +++ b/test/files/neg/t4283b.check @@ -0,0 +1,4 @@ +Test.scala:2: error: Unable to access method f in class AbstractFoo with a super reference. + override def f(): Int = super.f() + ^ +one error found diff --git a/test/files/neg/t4283b/AbstractFoo.java b/test/files/neg/t4283b/AbstractFoo.java new file mode 100644 index 0000000000..7abcd5e76b --- /dev/null +++ b/test/files/neg/t4283b/AbstractFoo.java @@ -0,0 +1,5 @@ +package test; + +/* package private */ class AbstractFoo { + public int f() { return 2; } +} diff --git a/test/pending/run/t4283/ScalaBipp.scala b/test/files/neg/t4283b/ScalaBipp.scala index 36dea9f4de..36dea9f4de 100644 --- a/test/pending/run/t4283/ScalaBipp.scala +++ b/test/files/neg/t4283b/ScalaBipp.scala diff --git a/test/files/neg/t4283b/Test.scala b/test/files/neg/t4283b/Test.scala new file mode 100644 index 0000000000..0dc5636ff8 --- /dev/null +++ b/test/files/neg/t4283b/Test.scala @@ -0,0 +1,3 @@ +object Derived extends test.ScalaBipp { + override def f(): Int = super.f() +} diff --git a/test/files/run/t4283.check b/test/files/run/t4283.check new file mode 100644 index 0000000000..0d27989761 --- /dev/null +++ b/test/files/run/t4283.check @@ -0,0 +1,5 @@ +2 +2 +1 +1 +1 diff --git a/test/pending/run/t4283/AbstractFoo.java b/test/files/run/t4283/AbstractFoo.java index 0403271b74..0403271b74 100644 --- a/test/pending/run/t4283/AbstractFoo.java +++ b/test/files/run/t4283/AbstractFoo.java diff --git a/test/files/run/t4283/ScalaBipp.scala b/test/files/run/t4283/ScalaBipp.scala new file mode 100644 index 0000000000..36dea9f4de --- /dev/null +++ b/test/files/run/t4283/ScalaBipp.scala @@ -0,0 +1,5 @@ +package test + +class ScalaBipp extends AbstractFoo { + def make: Option[ScalaBipp] = Option(this) +} diff --git a/test/pending/run/t4283/IllegalAccess.scala b/test/files/run/t4283/Test.scala index 33039c9350..af72fa62f9 100644 --- a/test/pending/run/t4283/IllegalAccess.scala +++ b/test/files/run/t4283/Test.scala @@ -1,8 +1,7 @@ -package other +object Test { -object IllegalAccess { def main(args: Array[String]) { - val x = (new test.ScalaBipp).make.get.asInstanceOf[test.ScalaBipp].f() + val x = (new test.ScalaBipp).make.get.asInstanceOf[test.ScalaBipp].f() println(x) val y = (new test.ScalaBipp).make.get.f() println(y) diff --git a/test/files/run/t5162.scala b/test/files/run/t5162.scala new file mode 100644 index 0000000000..4f91932b6e --- /dev/null +++ b/test/files/run/t5162.scala @@ -0,0 +1,19 @@ +// In run, rather than pos, to check for problems like SI-4283 +object O1 { + private[O1] class Base { + def foo: Int = 0 + } + class Mediator extends Base +} + +object O2 { + class Derived extends O1.Mediator { + override def foo: Int = super.foo + } +} + +object Test { + def main(args: Array[String]) { + new O2.Derived().foo + } +} |