From 636af2e98c9af707b944724e439d6e39bb3b074e Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Tue, 28 Jun 2016 11:55:58 -0700 Subject: SI-8339 drop deprecated fallback `withFilter` -> `filter` You must implement the `withFilter` method to use `if`-guards in a `for`-comprehension. (Drop pos/t7239.scala because it relied on this rewrite.) --- test/files/neg/t6455.flags | 1 - test/files/neg/t6455.scala | 4 ++-- test/files/pos/t7239.scala | 38 -------------------------------------- 3 files changed, 2 insertions(+), 41 deletions(-) delete mode 100644 test/files/neg/t6455.flags delete mode 100644 test/files/pos/t7239.scala (limited to 'test/files') diff --git a/test/files/neg/t6455.flags b/test/files/neg/t6455.flags deleted file mode 100644 index 112fc720a0..0000000000 --- a/test/files/neg/t6455.flags +++ /dev/null @@ -1 +0,0 @@ --Xfuture \ No newline at end of file diff --git a/test/files/neg/t6455.scala b/test/files/neg/t6455.scala index ebbb37f1cd..22e4c30fdd 100644 --- a/test/files/neg/t6455.scala +++ b/test/files/neg/t6455.scala @@ -1,6 +1,6 @@ object O { def filter(p: Int => Boolean): O.type = this } class Test { - // should not compile because we no longer rewrite withFilter => filter under -Xfuture + // should not compile because we no longer rewrite withFilter => filter O.withFilter(f => true) -} \ No newline at end of file +} diff --git a/test/files/pos/t7239.scala b/test/files/pos/t7239.scala deleted file mode 100644 index 16e9d00f17..0000000000 --- a/test/files/pos/t7239.scala +++ /dev/null @@ -1,38 +0,0 @@ -object Test { - def BrokenMethod(): HasFilter[(Int, String)] = ??? - - trait HasFilter[B] { - def filter(p: B => Boolean) = ??? - } - - trait HasWithFilter { - def withFilter = ??? - } - - object addWithFilter { - trait NoImplicit - implicit def enrich(v: Any) - (implicit F0: NoImplicit): HasWithFilter = ??? - } - - BrokenMethod().withFilter(_ => true) // okay - BrokenMethod().filter(_ => true) // okay - - locally { - import addWithFilter._ - BrokenMethod().withFilter((_: (Int, String)) => true) // okay - } - - locally { - import addWithFilter._ - // adaptToMemberWithArgs sets the type of the tree `x` - // to ErrorType (while in silent mode, so the error is not - // reported. Later, when the fallback from `withFilter` - // to `filter` is attempted, the closure is taken to have - // have the type ` => Boolean`, which conforms to - // `(B => Boolean)`. Only later during pickling does the - // defensive check for erroneous types in the tree pick up - // the problem. - BrokenMethod().withFilter(x => true) // erroneous or inaccessible type. - } -} -- cgit v1.2.3