From d04cd7b39107fb7cb817a08265724c00043b1396 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Wed, 24 Sep 2014 10:31:33 -0700 Subject: SI-8861 Handle alias when probing for Any If args to a method are alias types, dealias to see if they contain Any before warning about inferring it. Similarly for return and expected types. --- test/files/pos/t8861.flags | 1 + test/files/pos/t8861.scala | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 test/files/pos/t8861.flags create mode 100644 test/files/pos/t8861.scala (limited to 'test') diff --git a/test/files/pos/t8861.flags b/test/files/pos/t8861.flags new file mode 100644 index 0000000000..99a6391058 --- /dev/null +++ b/test/files/pos/t8861.flags @@ -0,0 +1 @@ +-Xlint:infer-any -Xfatal-warnings diff --git a/test/files/pos/t8861.scala b/test/files/pos/t8861.scala new file mode 100644 index 0000000000..816d15700e --- /dev/null +++ b/test/files/pos/t8861.scala @@ -0,0 +1,11 @@ + +trait Test { + type R = PartialFunction[Any, Unit] + + val x: R = { case "" => } + val y: R = { case "" => } + + val z: R = x orElse y + val zz = x orElse y +} + -- cgit v1.2.3