From 617706644139d5731b10b3c77c647e3b70aa07b3 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Sun, 10 Jun 2012 23:38:39 +0200 Subject: SI-5162 Exclude super.foo from the erasure cast of SI-4283 If the target method is defined in Java, treat the super reference as an error, otherwise allow it in the knowledge that Scala loosens the access restrictions on its generated classes. Moves the test for that bug out of pending-ville. It's sufficient to place Test in the empty package to exercise the right code paths. --- test/files/neg/t4283b/AbstractFoo.java | 5 +++++ test/files/neg/t4283b/ScalaBipp.scala | 5 +++++ test/files/neg/t4283b/Test.scala | 3 +++ 3 files changed, 13 insertions(+) create mode 100644 test/files/neg/t4283b/AbstractFoo.java create mode 100644 test/files/neg/t4283b/ScalaBipp.scala create mode 100644 test/files/neg/t4283b/Test.scala (limited to 'test/files/neg/t4283b') 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/files/neg/t4283b/ScalaBipp.scala b/test/files/neg/t4283b/ScalaBipp.scala new file mode 100644 index 0000000000..36dea9f4de --- /dev/null +++ b/test/files/neg/t4283b/ScalaBipp.scala @@ -0,0 +1,5 @@ +package test + +class ScalaBipp extends AbstractFoo { + def make: Option[ScalaBipp] = Option(this) +} 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() +} -- cgit v1.2.3