diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-06-19 12:58:38 -0700 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2013-06-19 12:58:38 -0700 |
commit | f467940e5980621f8c288f8d47656061b1a0f15d (patch) | |
tree | 0c7475ae78a68d57b417cc2e7a7ec67808719d0f /test/files/run | |
parent | 16ea58b34b37947f40b3d9f90356a64099b250a7 (diff) | |
parent | b49b6cf7f0f42d74da854d96eeb0f863357c04cd (diff) | |
download | scala-f467940e5980621f8c288f8d47656061b1a0f15d.tar.gz scala-f467940e5980621f8c288f8d47656061b1a0f15d.tar.bz2 scala-f467940e5980621f8c288f8d47656061b1a0f15d.zip |
Merge pull request #2635 from retronym/ticket/7151
SI-7151 Emit final in bytecode for final inner classes.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t7151.check | 6 | ||||
-rw-r--r-- | test/files/run/t7151.scala | 24 |
2 files changed, 30 insertions, 0 deletions
diff --git a/test/files/run/t7151.check b/test/files/run/t7151.check new file mode 100644 index 0000000000..d532d9589f --- /dev/null +++ b/test/files/run/t7151.check @@ -0,0 +1,6 @@ +class Test$InnerObject$ isFinal = false +class Test$InnerCase isFinal = true +class Test$InnerNonCase isFinal = true +class TopLevelObject$ isFinal = true +class TopLevelCase isFinal = true +class TopLevelNonCase isFinal = true diff --git a/test/files/run/t7151.scala b/test/files/run/t7151.scala new file mode 100644 index 0000000000..f6492ba43c --- /dev/null +++ b/test/files/run/t7151.scala @@ -0,0 +1,24 @@ +import java.lang.reflect.Modifier.isFinal + +object Test { + object InnerObject + final case class InnerCase() + final class InnerNonCase() + + def main(args: Array[String]) { + def checkFinal(clazz: Class[_]) = + println(s"${clazz} isFinal = ${isFinal(clazz.getModifiers())}") + + checkFinal(InnerObject.getClass) + checkFinal(classOf[InnerCase]) + checkFinal(classOf[InnerNonCase]) + + checkFinal(TopLevelObject.getClass) + checkFinal(classOf[TopLevelCase]) + checkFinal(classOf[TopLevelNonCase]) + } +} + +object TopLevelObject +final case class TopLevelCase() +final case class TopLevelNonCase() |