File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change
1
+ object Test {
2
+ case class A ()
3
+ case class B ()
4
+
5
+ def foo [A , B ]: implicit A => implicit B => Int = { implicit b : B =>
6
+ 42 // error: found Int, required: implicit A => implicit B => Int
7
+ }
8
+ }
Original file line number Diff line number Diff line change 4
4
A()
5
5
(A(),B())
6
6
(A(),B())
7
+ (A(),B())
8
+ (A(),B())
9
+ (A(),B())
Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ object Test {
7
7
def foo [A , B ]: implicit A => implicit B => (A , B ) =
8
8
(implicitly[A ], implicitly[B ])
9
9
10
+ def bar [A , B ]: implicit A => implicit B => (A , B ) = { implicit a : A =>
11
+ (implicitly[A ], implicitly[B ])
12
+ }
13
+
10
14
implicit val a : A = A ()
11
15
implicit val b : B = B ()
12
16
@@ -20,5 +24,9 @@ object Test {
20
24
println(x0)
21
25
val x1 : implicit B => (A , B ) = foo[A , B ]
22
26
println(x1)
27
+
28
+ println(bar[A , B ])
29
+ println(bar[A , B ](a))
30
+ println(bar(a)(b))
23
31
}
24
32
}
You can’t perform that action at this time.
0 commit comments