diff options
Diffstat (limited to 'test/files/jvm/innerClassAttribute/Classes_1.scala')
-rw-r--r-- | test/files/jvm/innerClassAttribute/Classes_1.scala | 92 |
1 files changed, 90 insertions, 2 deletions
diff --git a/test/files/jvm/innerClassAttribute/Classes_1.scala b/test/files/jvm/innerClassAttribute/Classes_1.scala index 0875d9160c..9c3ea7f013 100644 --- a/test/files/jvm/innerClassAttribute/Classes_1.scala +++ b/test/files/jvm/innerClassAttribute/Classes_1.scala @@ -74,7 +74,7 @@ class A14 { object A15 { def f = { - class B { // static (does not have an outer pointer) + class B { // non-static, even though it doesn't have an outer pointer class C // non-static } } @@ -90,10 +90,98 @@ class A16 { class V extends A6 new A6 { } } + + new A6 { } } class A17 { object B { - class C // not static, has an outer pointer. + class C // not static, also has an outer pointer. + } +} + +class A18 { + def f = { + def g = { + class A + new A6 { } + val y = { + if ((new Object).hashCode() == 1) {class B {} ; new B} else 2 + if ((new Object).hashCode() == 1) new A6 { } else "haifish" + } + } + } +} + +class A19 { + ((x: Int) => x + 3) + + val x = { + ((x: Int) => x + 1) + } + + { + ((x: Int) => x + 2) + } +} + +class A20 { + () => { + {() => ()} + {() => () => 1} + } +} + +class A21 { + class I1 + def f = { class J1 } +} +object A21 { + class I2 + object I3 { + class J2 // static + } + def g = { class J3 } // non-static + val x = { class J4 } // non-static + { + class J5 // non-static (!) + new J5 + } +} + +class A22 { + class C + object C { + class D // inner class of C$, not of C. Not added to the inner class table of C, only to C$ + } +} + +class A23 { + def f = { + val a = new Java_A_1() + val c = new Java_A_1.C() + val d = new Java_A_1.C.D() + val e = new c.E() + val f = new a.F() + val g = new f.G() + } +} + +trait A24Sym + +trait A24Base { + // trait with concrete members: interface plus (absract) impl class + trait DefinitionsApi { + def Abs: A24Sym + def Conc: A24Sym = new A24Sym { } + } +} + +trait A24 extends A24Base { + class DefinitionsClass extends DefinitionsApi { + // bridge methods are generated for Abs and Conc. there used to be a bug: the bridge symbol was a ModuleSymbol, + // calling companionClass would return NoSymbol. i changed erasure to make the bridge symbol is a MethodSymbol. + object Abs extends A24Sym + override object Conc extends A24Sym } } |