summaryrefslogtreecommitdiff
path: root/test/files/run/t7151.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-06-06 13:41:15 +0200
committerJason Zaugg <jzaugg@gmail.com>2013-06-07 21:53:52 +0200
commitb49b6cf7f0f42d74da854d96eeb0f863357c04cd (patch)
tree3710705d5a15c68fd7b3af24ae725d204d422985 /test/files/run/t7151.scala
parent5312d6305530eb14d369d0f4acaf7ca4e278ea72 (diff)
downloadscala-b49b6cf7f0f42d74da854d96eeb0f863357c04cd.tar.gz
scala-b49b6cf7f0f42d74da854d96eeb0f863357c04cd.tar.bz2
scala-b49b6cf7f0f42d74da854d96eeb0f863357c04cd.zip
SI-7151 Emit final in bytecode for final inner classes.
As we did before a regression in 18efdedfb / SI-5676. This commit tightens up the condition in which the FINAL modifier is omitted; it now *only* does this for the module classes of nested objects.
Diffstat (limited to 'test/files/run/t7151.scala')
-rw-r--r--test/files/run/t7151.scala24
1 files changed, 24 insertions, 0 deletions
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()