Skip to content

Commit 6436b4b

Browse files
committed
Add example of implicit conversion that would be overlooked
1 parent 70360fc commit 6436b4b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
object Test {
3+
4+
implicit def F2ToT2(f: Function2[Int, Int, Int]): Tuple2[Int, Int] => Int = {
5+
???
6+
x => f(x._1, x._2)
7+
}
8+
9+
def main(args: Array[String]): Unit = {
10+
val f: Tuple2[Int, Int] => Int = (x: Int, y: Int) => x + y
11+
f((3, 4))
12+
}
13+
14+
}

0 commit comments

Comments
 (0)