Skip to content

Commit 9fb45c9

Browse files
committed
Fix neg test
1 parent de62914 commit 9fb45c9

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
-- [E007] Type Mismatch Error: boxmap.scala:15:2 -------------------------------
2-
15 | () => b[Box[B]]((x: A) => box(f(x)))
3-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4-
| Found: (() => Box[B]) retains b retains f
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
55
| Required: () => Box[B]
66
|
7-
| where: B is a type in method lazymap with bounds <: Top
7+
| where: B is a type in method lazymap with bounds <: Top
88

99
longer explanation available when compiling with `-explain`
10-
1 error found

tests/neg-custom-args/captures/boxmap.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ def box[T <: Top](x: T): Box[T] =
1111
def map[A <: Top, B <: Top](b: Box[A])(f: A ==> B): Box[B] =
1212
b[Box[B]]((x: A) => box(f(x)))
1313

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

0 commit comments

Comments
 (0)