From c30ed29f6cee9d4e0bd4a99c4be804ffcb20d281 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 19 Jan 2015 13:42:35 +1000 Subject: SI-9093 Fix value discarding / multiple param list crasher The type error stemming from missing argument list was being swallowed when the expected type was `Unit` and there were undetermined type parameters in the expression. This commit modifies `adapt` to avoid using `instantiateExpectingUnit` when the tree is typed with `MethodType`. --- test/files/neg/t9093.check | 6 ++++++ test/files/neg/t9093.scala | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 test/files/neg/t9093.check create mode 100644 test/files/neg/t9093.scala (limited to 'test/files') diff --git a/test/files/neg/t9093.check b/test/files/neg/t9093.check new file mode 100644 index 0000000000..085a433f0b --- /dev/null +++ b/test/files/neg/t9093.check @@ -0,0 +1,6 @@ +t9093.scala:3: error: polymorphic expression cannot be instantiated to expected type; + found : [C](f: C)Null + required: Unit + val x: Unit = apply2(0)/*(0)*/ + ^ +one error found diff --git a/test/files/neg/t9093.scala b/test/files/neg/t9093.scala new file mode 100644 index 0000000000..d9922ad70e --- /dev/null +++ b/test/files/neg/t9093.scala @@ -0,0 +1,5 @@ +object Main { + def apply2[C](fa: Any)(f: C) = null + val x: Unit = apply2(0)/*(0)*/ +} + -- cgit v1.2.3