From 5cbd7d06eb8fe81bc3812ee99de05b1f4bd820fe Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 23 Jan 2012 08:19:32 -0800 Subject: Figured out the "$class$1" problem. In lambda lift traits are renamed independently of their implementation classes, leading in the case of a method-defined trait to an interface called A$1 and an impl class called A$class$1 rather than A$1$class. This is now remedied. --- test/files/run/trait-renaming.check | 2 ++ test/files/run/trait-renaming/A_1.scala | 15 +++++++++++++++ test/files/run/trait-renaming/B_2.scala | 5 +++++ 3 files changed, 22 insertions(+) create mode 100644 test/files/run/trait-renaming.check create mode 100644 test/files/run/trait-renaming/A_1.scala create mode 100644 test/files/run/trait-renaming/B_2.scala (limited to 'test') diff --git a/test/files/run/trait-renaming.check b/test/files/run/trait-renaming.check new file mode 100644 index 0000000000..b2e5affde5 --- /dev/null +++ b/test/files/run/trait-renaming.check @@ -0,0 +1,2 @@ +public static int bippy.A$B$1$class.f(bippy.A$B$1) +public static void bippy.A$B$1$class.$init$(bippy.A$B$1) diff --git a/test/files/run/trait-renaming/A_1.scala b/test/files/run/trait-renaming/A_1.scala new file mode 100644 index 0000000000..2c3d4f566f --- /dev/null +++ b/test/files/run/trait-renaming/A_1.scala @@ -0,0 +1,15 @@ +package bippy { + class A { + def f = { + trait B { + def f = 5 + } + trait C { + def g = 10 + } + new B with C { } + } + + def g = Class.forName("bippy.A$B$1$class") + } +} diff --git a/test/files/run/trait-renaming/B_2.scala b/test/files/run/trait-renaming/B_2.scala new file mode 100644 index 0000000000..174e929fe2 --- /dev/null +++ b/test/files/run/trait-renaming/B_2.scala @@ -0,0 +1,5 @@ +object Test { + def main(args: Array[String]): Unit = { + (new bippy.A).g.getDeclaredMethods.map(_.toString).sorted foreach println + } +} -- cgit v1.2.3