diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2016-05-19 08:33:31 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@typesafe.com> | 2016-05-19 08:33:31 +0200 |
commit | 960e4d76a382ff009c66346289db10b2ee598aa5 (patch) | |
tree | d15ddddd1bd1cea4fe6afc811a0771e9113eb24a /test/junit/scala/issues/BytecodeTest.scala | |
parent | 41c9a17e4f211fc24a931949a0819a0474cc004a (diff) | |
parent | a5fab1f588a6042ca924a78d225e85d0acddf5db (diff) | |
download | scala-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.scala | 10 |
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 { |