diff options
author | Paul Phillips <paulp@improving.org> | 2012-01-04 23:47:41 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-01-04 23:55:51 -0800 |
commit | be46e487134305edae065de00582928c120bcfbb (patch) | |
tree | f20679fe453ade9e72e9220dabcc574e0e5246fc /test | |
parent | bedb33fd7cb3439a129dff15e1ea1341c5c8fe7d (diff) | |
download | scala-be46e487134305edae065de00582928c120bcfbb.tar.gz scala-be46e487134305edae065de00582928c120bcfbb.tar.bz2 scala-be46e487134305edae065de00582928c120bcfbb.zip |
Fix for NoSuchMethod in cleanup.
Don't assume that just because someone is calling x.toInt
and x <: java.lang.Number, that it's a boxed primitive.
Closes SI-5356.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t5356.check | 6 | ||||
-rw-r--r-- | test/files/run/t5356.scala | 12 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test/files/run/t5356.check b/test/files/run/t5356.check new file mode 100644 index 0000000000..21c4aef07b --- /dev/null +++ b/test/files/run/t5356.check @@ -0,0 +1,6 @@ +1 scala.runtime.RichInt +1 scala.runtime.RichInt +1 scala.math.BigInt +1 scala.runtime.RichDouble +1 scala.runtime.RichFloat +1 diff --git a/test/files/run/t5356.scala b/test/files/run/t5356.scala new file mode 100644 index 0000000000..f7696c6088 --- /dev/null +++ b/test/files/run/t5356.scala @@ -0,0 +1,12 @@ +object Test { + def f(x: { def toInt: Int }) = println(x.toInt + " " + x.getClass.getName) + + def main(args: Array[String]): Unit = { + f(1) + f(1.toInt) + f(BigInt(1)) + f(1d) + f(1f) + println((1: { def toInt: Int }).toInt) + } +} |