From be46e487134305edae065de00582928c120bcfbb Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Wed, 4 Jan 2012 23:47:41 -0800 Subject: 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. --- test/files/run/t5356.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/files/run/t5356.scala (limited to 'test/files/run/t5356.scala') 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) + } +} -- cgit v1.2.3