From 0bea2ab5f6b211a83bbf14ea46fe57b8163c6334 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 28 Nov 2011 08:03:10 +0000 Subject: Fix for erroneous bytecode generation. A remedy for an IllegalAccessError where generated bytecode referred to an inaccessible type. Closes SI-1430. Bonus materials: - tore out all the invokedynamic support. The shipped jdk7 implementation shows limited resemblance to the one this was written against; the code mostly serves to distract. (I think I could get invokedynamic working pretty quickly, except that it would mean having a codebase for java7 and one for 5-6, which is not a yak I wish to shave today.) - gave NullClass and NothingClass objects of their own, which allowed a nice polymorphic simplification of isSubClass, plus a couple other streamlinings. --- test/files/run/t1430.check | 1 + test/files/run/t1430/Bar_1.java | 8 ++++++++ test/files/run/t1430/Test_2.scala | 16 ++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 test/files/run/t1430.check create mode 100644 test/files/run/t1430/Bar_1.java create mode 100644 test/files/run/t1430/Test_2.scala (limited to 'test/files/run') diff --git a/test/files/run/t1430.check b/test/files/run/t1430.check new file mode 100644 index 0000000000..a688182701 --- /dev/null +++ b/test/files/run/t1430.check @@ -0,0 +1 @@ +Baz diff --git a/test/files/run/t1430/Bar_1.java b/test/files/run/t1430/Bar_1.java new file mode 100644 index 0000000000..4db2eafcbd --- /dev/null +++ b/test/files/run/t1430/Bar_1.java @@ -0,0 +1,8 @@ +package j; + +interface Foo { + public void foo(); +} +public interface Bar_1 extends Foo { + public void bar(); +} diff --git a/test/files/run/t1430/Test_2.scala b/test/files/run/t1430/Test_2.scala new file mode 100644 index 0000000000..7af65de5cd --- /dev/null +++ b/test/files/run/t1430/Test_2.scala @@ -0,0 +1,16 @@ +package s { + object Boop extends j.Bar_1 { + def foo() {} + def bar() {} + } + class Baz(x: j.Bar_1) { + x.foo + override def toString = "Baz" + } +} + +object Test { + def main(args: Array[String]): Unit = { + println(new s.Baz(s.Boop)) + } +} -- cgit v1.2.3