diff options
author | Stefan Zeiger <szeiger@novocode.com> | 2016-08-12 13:36:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-12 13:36:27 +0200 |
commit | 1950412f6d4118433408444ace371eb020342711 (patch) | |
tree | d1b69d212b929acebcd1b5491c13bbfca6def511 /test | |
parent | fdb3105228db20e347a61e61e2e1d86b27683d0d (diff) | |
parent | 636af2e98c9af707b944724e439d6e39bb3b074e (diff) | |
download | scala-1950412f6d4118433408444ace371eb020342711.tar.gz scala-1950412f6d4118433408444ace371eb020342711.tar.bz2 scala-1950412f6d4118433408444ace371eb020342711.zip |
Merge pull request #5252 from adriaanm/t8339
SI-8339 remove deprecated rewrite of withFilter -> filter
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/t6455.flags | 1 | ||||
-rw-r--r-- | test/files/neg/t6455.scala | 4 | ||||
-rw-r--r-- | test/files/pos/t7239.scala | 38 |
3 files changed, 2 insertions, 41 deletions
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 `<error> => 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. - } -} |