diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-07-20 14:55:02 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-07-20 14:55:02 -0700 |
commit | cf01182857f7dc47eb865cd904fbb725f2de2e72 (patch) | |
tree | 8ec07af11311fad75e36ae73b2b1dacc6a0064ae /test | |
parent | 15fba6bd2eb45ca47e975ef033aaf20136d71c67 (diff) | |
parent | e0853b3255c5a10793b462c36b62b83963aad17b (diff) | |
download | scala-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')
-rw-r--r-- | test/files/run/outertest.scala | 26 |
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) + +} |