summaryrefslogtreecommitdiff
path: root/test/junit/scala/issues/BytecodeTest.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@typesafe.com>2016-05-19 08:33:31 +0200
committerLukas Rytz <lukas.rytz@typesafe.com>2016-05-19 08:33:31 +0200
commit960e4d76a382ff009c66346289db10b2ee598aa5 (patch)
treed15ddddd1bd1cea4fe6afc811a0771e9113eb24a /test/junit/scala/issues/BytecodeTest.scala
parent41c9a17e4f211fc24a931949a0819a0474cc004a (diff)
parenta5fab1f588a6042ca924a78d225e85d0acddf5db (diff)
downloadscala-960e4d76a382ff009c66346289db10b2ee598aa5.tar.gz
scala-960e4d76a382ff009c66346289db10b2ee598aa5.tar.bz2
scala-960e4d76a382ff009c66346289db10b2ee598aa5.zip
Merge pull request #5176 from lrytz/t9671
SI-9671, SI-7397 fix null.asInstanceOf[Int] when pt erases to Object
Diffstat (limited to 'test/junit/scala/issues/BytecodeTest.scala')
-rw-r--r--test/junit/scala/issues/BytecodeTest.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/junit/scala/issues/BytecodeTest.scala b/test/junit/scala/issues/BytecodeTest.scala
index a720f20718..7b9474b52e 100644
--- a/test/junit/scala/issues/BytecodeTest.scala
+++ b/test/junit/scala/issues/BytecodeTest.scala
@@ -419,6 +419,16 @@ class BytecodeTest extends ClearAfterClass {
assertInvoke(getSingleMethod(c, "f3"), "java/lang/Object", "hashCode")
assertInvoke(getSingleMethod(c, "f4"), "java/lang/Object", "toString")
}
+
+ @Test
+ def superConstructorArgumentInSpecializedClass(): Unit = {
+ // see comment in SpecializeTypes.forwardCtorCall
+ val code = "case class C[@specialized(Int) T](_1: T)"
+ val List(c, cMod, cSpec) = compileClasses(compiler)(code)
+ assertSameSummary(getSingleMethod(cSpec, "<init>"),
+ // pass `null` to super constructor, no box-unbox, no Integer created
+ List(ALOAD, ILOAD, PUTFIELD, ALOAD, ACONST_NULL, "<init>", RETURN))
+ }
}
object invocationReceiversTestCode {