summaryrefslogtreecommitdiff
path: root/test/files/jvm/innerClassAttribute/Classes_1.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2014-08-12 10:57:42 +0200
committerLukas Rytz <lukas.rytz@gmail.com>2014-08-12 11:03:40 +0200
commit0270972b9f70d107dff393081dc48c877be1f161 (patch)
tree1d1a4021325c600a26e41e1589f99194f3f96d51 /test/files/jvm/innerClassAttribute/Classes_1.scala
parent50167e3f1df664165a2ad485abace5dbce623996 (diff)
downloadscala-0270972b9f70d107dff393081dc48c877be1f161.tar.gz
scala-0270972b9f70d107dff393081dc48c877be1f161.tar.bz2
scala-0270972b9f70d107dff393081dc48c877be1f161.zip
test for InnerClass and EnclosingMethod attributes
Some parts of the test assert (current) buggy behavior. This is marked in the test file with TODO. It will be fixed in later work on the backend.
Diffstat (limited to 'test/files/jvm/innerClassAttribute/Classes_1.scala')
-rw-r--r--test/files/jvm/innerClassAttribute/Classes_1.scala99
1 files changed, 99 insertions, 0 deletions
diff --git a/test/files/jvm/innerClassAttribute/Classes_1.scala b/test/files/jvm/innerClassAttribute/Classes_1.scala
new file mode 100644
index 0000000000..0875d9160c
--- /dev/null
+++ b/test/files/jvm/innerClassAttribute/Classes_1.scala
@@ -0,0 +1,99 @@
+class A1 {
+ class B
+}
+
+class A2 {
+ object B
+}
+
+object A3 {
+ class B1
+ object B2
+}
+
+class A4 {
+ def f(l: List[Int]): List[Int] = {
+ l map (_ + 1)
+ }
+}
+
+class A5 {
+ def f(): Object = {
+ object B
+ B
+ }
+}
+
+trait A6 {
+ def hui = -6
+ trait TT
+}
+
+class A7 extends A6
+
+abstract class A8 extends A6 {
+ def fish: TT
+}
+
+class A9 {
+ class brick extends annotation.StaticAnnotation
+}
+
+class A10 {
+ val a9 = new A9()
+ // there's no reference to brick in the bytecode (only in the pickle), so there's no InnerClass attribute for it.
+ @a9.brick def f = -7
+}
+
+class A11 {
+ @JavaAnnot_1.Ann def f = -8
+}
+
+object A12 {
+ object B {
+ class C
+ }
+}
+
+class A13 {
+ def oak: A12.B.C = new A12.B.C
+}
+
+class A14 {
+ def f = {
+ val x: Object = {
+ class K
+ new K
+ }
+ x
+ }
+ def g = {
+ val x: Object = new A6 { }
+ }
+}
+
+object A15 {
+ def f = {
+ class B { // static (does not have an outer pointer)
+ class C // non-static
+ }
+ }
+}
+
+class A16 {
+ val x: A6 = {
+ class U extends A6
+ new A6 { }
+ }
+
+ {
+ class V extends A6
+ new A6 { }
+ }
+}
+
+class A17 {
+ object B {
+ class C // not static, has an outer pointer.
+ }
+}