From fd21898db304f45fa12178662c9f1e5b793d6830 Mon Sep 17 00:00:00 2001 From: James Iry Date: Fri, 8 Mar 2013 08:31:57 -0800 Subject: SI-7231 Fix assertion when adapting Null type to Array type GenICode was doing a sanity check when adapting an expression of type Null to something else. It was just doing the wrong one. Instead of checking whether the result expression type was a reference type it was checking to see if it was an class reference type. This commit fixes that and adds a test to make sure both forms of adaptation work as expected. --- test/files/run/t7231.scala | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/files/run/t7231.scala (limited to 'test/files/run/t7231.scala') diff --git a/test/files/run/t7231.scala b/test/files/run/t7231.scala new file mode 100644 index 0000000000..7d6bc81f3f --- /dev/null +++ b/test/files/run/t7231.scala @@ -0,0 +1,11 @@ +object Test extends App { + val bar: Null = null + + def foo(x: Array[Int]) = x + def baz(x: String) = x + + // first line was failing + println(foo(bar)) + // this line worked but good to have a double check + println(baz(bar)) +} \ No newline at end of file -- cgit v1.2.3