File tree 2 files changed +7
-8
lines changed
tests/neg-custom-args/captures 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 1
- [31m -- [E007] Type Mismatch Error: boxmap.scala:15:2 -------------------------------[0m
2
- [31m15 |[0m () => b[[35mBox[B][0m ](([36mx[0m: [35mA[0m ) => box(f(x)))
3
- | [31m ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^[0m
4
- | Found: ([1m[31m([0m ) => Box[B][1m[31m)[0m[1m[31m [0m[1m[31mretains[0m[1m[31m [0m[1m[31mb[0m[1m[31m [0m[1m[31mretains[0m[1m[31m [0m[1m[31mf[0m
1
+ -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/ boxmap.scala:15:2 ----------------------------------------
2
+ 15 | () => b[Box[B] ]((x: A ) => box(f(x))) // error
3
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4
+ | Found: (( ) => Box[B]) retains b retains f
5
5
| Required: () => Box[B]
6
6
|
7
- | where: B is a type in [33mmethod[0m [35mlazymap[0m with bounds <: Top
7
+ | where: B is a type in method lazymap with bounds <: Top
8
8
9
9
longer explanation available when compiling with `-explain`
10
- 1 error found
Original file line number Diff line number Diff line change @@ -11,5 +11,5 @@ def box[T <: Top](x: T): Box[T] =
11
11
def map [A <: Top , B <: Top ](b : Box [A ])(f : A ==> B ): Box [B ] =
12
12
b[Box [B ]]((x : A ) => box(f(x)))
13
13
14
- def lazymap [A <: Top , B <: Top ](b : Box [A ])(f : A ==> B ): () => Box [B ] =// retains b. type | f. type =
15
- () => b[Box [B ]]((x : A ) => box(f(x)))
14
+ def lazymap [A <: Top , B <: Top ](b : Box [A ])(f : A ==> B ): () => Box [B ] =
15
+ () => b[Box [B ]]((x : A ) => box(f(x))) // error
You can’t perform that action at this time.
0 commit comments