diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-04-21 20:33:14 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-04-21 20:33:14 +0200 |
commit | 4004c4969b55a2f51e428cde4da58041876da82c (patch) | |
tree | e28d5976b00ce4178df4e05934024030fdc477fa /test/files/run | |
parent | 9ecb5c6423e55bd728621f79daf0c7c927bf41df (diff) | |
parent | dc656062c35040f28c8b7774710d899b79f2e401 (diff) | |
download | scala-4004c4969b55a2f51e428cde4da58041876da82c.tar.gz scala-4004c4969b55a2f51e428cde4da58041876da82c.tar.bz2 scala-4004c4969b55a2f51e428cde4da58041876da82c.zip |
Merge pull request #3634 from retronym/ticket/7992
SI-7992 Fix super-accessor generation after a local class
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t7992.scala | 20 | ||||
-rw-r--r-- | test/files/run/t7992b.scala | 18 |
2 files changed, 38 insertions, 0 deletions
diff --git a/test/files/run/t7992.scala b/test/files/run/t7992.scala new file mode 100644 index 0000000000..fde231b961 --- /dev/null +++ b/test/files/run/t7992.scala @@ -0,0 +1,20 @@ +class C { + def foo: Int = 0 +} + +class D extends C { + override def foo: Int = { + val f = () => { + class C // comment this line to fix. + D.super.foo // no super accessor generated here! + // java.lang.VerifyError: (class: D$$anonfun$1, method: apply$mcI$sp signature: ()I) Illegal use of nonvirtual function call + } + f() + } +} + +object Test { + def main(args: Array[String]) { + new D().foo + } +} diff --git a/test/files/run/t7992b.scala b/test/files/run/t7992b.scala new file mode 100644 index 0000000000..6fe1f990d5 --- /dev/null +++ b/test/files/run/t7992b.scala @@ -0,0 +1,18 @@ +class C { + def foo: Int = 0 +} + +class E extends C { + override def foo: Int = { + (None: Option[Int]).getOrElse { + class C + E.super.foo + } + } +} + +object Test { + def main(args: Array[String]) { + new E().foo + } +} |