summaryrefslogtreecommitdiff
path: root/test/files/pos/t6994.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-01-20 00:18:38 +0100
committerJason Zaugg <jzaugg@gmail.com>2013-01-20 00:18:38 +0100
commit8f498847020c5623559fa42d5d23e44fb74c8d22 (patch)
tree88442f82f585423b131787d9fb8b2bfa3133bf45 /test/files/pos/t6994.scala
parent6f72ed85c3882d2a8c824a41e6e42d7f33b8d1d6 (diff)
downloadscala-8f498847020c5623559fa42d5d23e44fb74c8d22.tar.gz
scala-8f498847020c5623559fa42d5d23e44fb74c8d22.tar.bz2
scala-8f498847020c5623559fa42d5d23e44fb74c8d22.zip
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.
Diffstat (limited to 'test/files/pos/t6994.scala')
-rw-r--r--test/files/pos/t6994.scala8
1 files changed, 8 insertions, 0 deletions
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."
+}