File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
main/scala/com/thoughtworks
test/scala/com/thoughtworks Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ sealed trait Extractor[-A, +B] extends (A => Option[B]) {
6868 }
6969
7070 // Convert an optional function to a PartialFunction
71- val pf2: PartialFunction[Int, String] = f .unlift
71+ val pf2: PartialFunction[Int, String] = Function .unlift(f)
7272
7373 util.Random.nextInt(4) match {
7474 case pf.extract(m) => // Convert a PartialFunction to a pattern
@@ -99,6 +99,7 @@ object Extractor extends LowPriorityExtractor {
9999 }
100100 }
101101
102+ @ deprecated(" Use Function.unlift instead" , " 1.1.0" )
102103 implicit final class OptionFunctionToPartialFunction [- A , + B ] private [Extractor ] (underlying : A => Option [B ]) {
103104 def unlift : PartialFunction [A , B ] = {
104105 case underlying.extract(b) => b
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ class ExtractorSpec extends FreeSpec with Matchers {
5454 None
5555 }
5656 }
57- val pf2 : PartialFunction [Int , String ] = f .unlift
57+ val pf2 : PartialFunction [Int , String ] = Function .unlift(f)
5858
5959 def test (i : Int ) = {
6060 i match {
You can’t perform that action at this time.
0 commit comments