File tree 4 files changed +10
-8
lines changed
compiler/src/dotty/tools/dotc/transform
tests/neg-custom-args/captures
4 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -310,7 +310,9 @@ abstract class Recheck extends Phase, IdentityDenotTransformer:
310
310
end recheck
311
311
312
312
def checkConforms (tpe : Type , pt : Type , tree : Tree )(using Context ): Unit = tree match
313
- case _ : DefTree | EmptyTree | _ : TypeTree =>
313
+ case _ : DefTree | EmptyTree | _ : TypeTree | _ : Closure =>
314
+ // Don't report closure nodes, since their span is a point; wait instead
315
+ // for enclosing block to preduce an error
314
316
case _ =>
315
317
val actual = tpe.widenExpr
316
318
val expected = pt.widenExpr
Original file line number Diff line number Diff line change 1
- -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/boxmap.scala:14:5 ----------------------------------------
1
+ -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/boxmap.scala:14:2 ----------------------------------------
2
2
14 | () => b[Box[B]]((x: A) => box(f(x))) // error
3
3
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4
4
| Found: {f} () => Box[B]
Original file line number Diff line number Diff line change 1
- -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/capt1.scala:3:5 ------------------------------------------
1
+ -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/capt1.scala:3:2 ------------------------------------------
2
2
3 | () => if x == null then y else y // error
3
3
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4
4
| Found: {x} () => C
5
5
| Required: () => C
6
6
7
7
longer explanation available when compiling with `-explain`
8
- -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/capt1.scala:6:5 ------------------------------------------
8
+ -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/capt1.scala:6:2 ------------------------------------------
9
9
6 | () => if x == null then y else y // error
10
10
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11
11
| Found: {x} () => C
@@ -33,7 +33,7 @@ longer explanation available when compiling with `-explain`
33
33
| Required: A
34
34
35
35
longer explanation available when compiling with `-explain`
36
- -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/capt1.scala:32:27 ----------------------------------------
36
+ -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/capt1.scala:32:24 ----------------------------------------
37
37
32 | val z2 = h[() => Cap](() => x)(() => C()) // error
38
38
| ^^^^^^^
39
39
| Found: {x} () => Cap
Original file line number Diff line number Diff line change 1
- -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/try.scala:29:35 ------------------------------------------
1
+ -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/try.scala:29:32 ------------------------------------------
2
2
29 | (x: CanThrow[Exception]) => () => raise(new Exception)(using x) // error
3
3
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4
4
| Found: {x} () => Nothing
5
5
| Required: () => Nothing
6
6
7
7
longer explanation available when compiling with `-explain`
8
- -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/try.scala:36:9 -------------------------------------------
8
+ -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/try.scala:36:6 -------------------------------------------
9
9
36 | () => // error
10
10
| ^
11
11
| Found: {x} () => Int
@@ -14,7 +14,7 @@ longer explanation available when compiling with `-explain`
14
14
38 | 22
15
15
16
16
longer explanation available when compiling with `-explain`
17
- -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/try.scala:47:7 -------------------------------------------
17
+ -- [E007] Type Mismatch Error: tests/neg-custom-args/captures/try.scala:47:4 -------------------------------------------
18
18
47 | () => // error
19
19
| ^
20
20
| Found: {x} () => Int
You can’t perform that action at this time.
0 commit comments