summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-07-20 14:55:02 -0700
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-07-20 14:55:02 -0700
commitcf01182857f7dc47eb865cd904fbb725f2de2e72 (patch)
tree8ec07af11311fad75e36ae73b2b1dacc6a0064ae /test/files
parent15fba6bd2eb45ca47e975ef033aaf20136d71c67 (diff)
parente0853b3255c5a10793b462c36b62b83963aad17b (diff)
downloadscala-cf01182857f7dc47eb865cd904fbb725f2de2e72.tar.gz
scala-cf01182857f7dc47eb865cd904fbb725f2de2e72.tar.bz2
scala-cf01182857f7dc47eb865cd904fbb725f2de2e72.zip
Merge pull request #954 from odersky/optimize/outer
Removes redundant outers
Diffstat (limited to 'test/files')
-rw-r--r--test/files/run/outertest.scala26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/files/run/outertest.scala b/test/files/run/outertest.scala
new file mode 100644
index 0000000000..3cc96afa5b
--- /dev/null
+++ b/test/files/run/outertest.scala
@@ -0,0 +1,26 @@
+// A test for the case where the outer field of class B#J should be eliminated.
+// You can verify this by running a javap on B.J
+abstract class A {
+
+ abstract class I {
+
+ }
+
+ val foo = "foo"
+
+}
+
+class B extends A {
+
+ class J extends I {
+ val bar = foo
+ }
+
+}
+
+object Test extends App {
+
+ val b = new B
+ assert((new b.J).bar == b.foo)
+
+}