diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/jvm/innerClassAttribute/Classes_1.scala | 37 | ||||
-rw-r--r-- | test/files/jvm/innerClassAttribute/Test.scala | 17 |
2 files changed, 53 insertions, 1 deletions
diff --git a/test/files/jvm/innerClassAttribute/Classes_1.scala b/test/files/jvm/innerClassAttribute/Classes_1.scala index bffc495b4f..27f01a880a 100644 --- a/test/files/jvm/innerClassAttribute/Classes_1.scala +++ b/test/files/jvm/innerClassAttribute/Classes_1.scala @@ -303,3 +303,40 @@ object NestedInValueClass { def f = { class C; new C } // outer class A$, outer method f } } + +object LocalAndAnonymousInLazyInitializer { + abstract class A + class C { + lazy val a: A = new A { } + lazy val b: A = { + class AA extends A + new AA + } + lazy val c: A = { + object AA extends A + AA + } + } + object O { + lazy val a: A = new A { } + lazy val b: A = { + class AA extends A + new AA + } + lazy val c: A = { + object AA extends A + AA + } + } + trait T { + lazy val a: A = new A { } + lazy val b: A = { + class AA extends A + new AA + } + lazy val c: A = { + object AA extends A + AA + } + } +}
\ No newline at end of file diff --git a/test/files/jvm/innerClassAttribute/Test.scala b/test/files/jvm/innerClassAttribute/Test.scala index 1b78773d42..5c666a615f 100644 --- a/test/files/jvm/innerClassAttribute/Test.scala +++ b/test/files/jvm/innerClassAttribute/Test.scala @@ -416,7 +416,7 @@ object Test extends BytecodeTest { def testAnonymousClassesMayBeNestedInSpecialized() { assertEnclosingMethod("AnonymousClassesMayBeNestedInSpecialized$C$$anon$17", "AnonymousClassesMayBeNestedInSpecialized$C", "foo", "(Ljava/lang/Object;)LAnonymousClassesMayBeNestedInSpecialized$A;") - assertEnclosingMethod("AnonymousClassesMayBeNestedInSpecialized$C$mcI$sp$$anon$18", "AnonymousClassesMayBeNestedInSpecialized$C$mcI$sp", "foo$mcI$sp", "(I)LAnonymousClassesMayBeNestedInSpecialized$A;") + assertEnclosingMethod("AnonymousClassesMayBeNestedInSpecialized$C$mcI$sp$$anon$21", "AnonymousClassesMayBeNestedInSpecialized$C$mcI$sp", "foo$mcI$sp", "(I)LAnonymousClassesMayBeNestedInSpecialized$A;") } def testNestedInValueClass() { @@ -444,6 +444,20 @@ object Test extends BytecodeTest { testInner("NestedInValueClass$A$", a, am, b, c, methodHandlesLookup) } + def testLocalAndAnonymousInLazyInitializer(): Unit = { + assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$C$$anon$18", "LocalAndAnonymousInLazyInitializer$C", null, null) + assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$C$AA$4", "LocalAndAnonymousInLazyInitializer$C", null, null) + assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$C$AA$5$", "LocalAndAnonymousInLazyInitializer$C", null, null) + + assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$O$$anon$19", "LocalAndAnonymousInLazyInitializer$O$", null, null) + assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$O$AA$6", "LocalAndAnonymousInLazyInitializer$O$", null, null) + assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$O$AA$7$", "LocalAndAnonymousInLazyInitializer$O$", null, null) + + assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$T$$anon$20", "LocalAndAnonymousInLazyInitializer$T", null, null) + assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$T$AA$8", "LocalAndAnonymousInLazyInitializer$T", null, null) + assertEnclosingMethod("LocalAndAnonymousInLazyInitializer$T$AA$9$", "LocalAndAnonymousInLazyInitializer$T", null, null) + } + def show(): Unit = { testA1() testA2() @@ -473,5 +487,6 @@ object Test extends BytecodeTest { testSpecializedClassesTopLevel() testAnonymousClassesMayBeNestedInSpecialized() testNestedInValueClass() + testLocalAndAnonymousInLazyInitializer() } } |