From 8f498847020c5623559fa42d5d23e44fb74c8d22 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Sun, 20 Jan 2013 00:18:38 +0100 Subject: SI-6994 Avoid spurious promiscuous catch warning It was being issued upon re-typechecking of a transformed tree. Now we disable the warning post-typer. --- test/files/pos/t6994.flags | 1 + test/files/pos/t6994.scala | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 test/files/pos/t6994.flags create mode 100644 test/files/pos/t6994.scala (limited to 'test/files/pos') diff --git a/test/files/pos/t6994.flags b/test/files/pos/t6994.flags new file mode 100644 index 0000000000..e8fb65d50c --- /dev/null +++ b/test/files/pos/t6994.flags @@ -0,0 +1 @@ +-Xfatal-warnings \ No newline at end of file diff --git a/test/files/pos/t6994.scala b/test/files/pos/t6994.scala new file mode 100644 index 0000000000..d707196423 --- /dev/null +++ b/test/files/pos/t6994.scala @@ -0,0 +1,8 @@ +object Test { + object NF { + def unapply(t: Throwable): Option[Throwable] = None + } + val x = (try { None } catch { case NF(ex) => None }) getOrElse 0 + // Was emitting a spurious warning post typer: + // "This catches all Throwables. If this is really intended, use `case ex6 : Throwable` to clear this warning." +} -- cgit v1.2.3