File tree 3 files changed +9
-9
lines changed
compiler/src/dotty/tools/dotc/cc
tests/neg-custom-args/captures
3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -1458,7 +1458,7 @@ class CheckCaptures extends Recheck, SymTransformer:
1458
1458
then
1459
1459
report.error(
1460
1460
em """ $expected cannot be box-converted to ${actual.capturing(leaked)}
1461
- |since the additional capture set $leaked resulted from box conversion is not allowed in $actual""" , tree.srcPos)
1461
+ |since the additional capture set $leaked resulting from box conversion is not allowed in $actual""" , tree.srcPos)
1462
1462
cs
1463
1463
1464
1464
def adaptedType (resultBoxed : Boolean ) =
Original file line number Diff line number Diff line change 1
1
-- Error: tests/neg-custom-args/captures/box-adapt-contra.scala:9:52 ---------------------------------------------------
2
2
9 | val f: (Cap^{c} -> Unit) -> Unit = useCap[Cap^{c}](c) // error
3
3
| ^^^^^^^^^^^^^^^^^^
4
- | Cap^{c} -> Unit cannot be box-converted to box Cap^{c} ->{c} Unit
5
- | since the additional capture set {c} resulted from box conversion is not allowed in box Cap^{c} -> Unit
4
+ | Cap^{c} -> Unit cannot be box-converted to box Cap^{c} ->{c} Unit
5
+ | since the additional capture set {c} resulting from box conversion is not allowed in box Cap^{c} -> Unit
6
6
-- Error: tests/neg-custom-args/captures/box-adapt-contra.scala:13:57 --------------------------------------------------
7
7
13 | val f1: (Cap^{c} => Unit) ->{c} Unit = useCap1[Cap^{c}](c) // error, was ok when cap was a root
8
8
| ^^^^^^^^^^^^^^^^^^^
9
- | Cap^{c} => Unit cannot be box-converted to box Cap^{c} ->{cap, c} Unit
10
- | since the additional capture set {c} resulted from box conversion is not allowed in box Cap^{c} => Unit
9
+ | Cap^{c} => Unit cannot be box-converted to box Cap^{c} ->{cap, c} Unit
10
+ | since the additional capture set {c} resulting from box conversion is not allowed in box Cap^{c} => Unit
11
11
-- Error: tests/neg-custom-args/captures/box-adapt-contra.scala:19:54 --------------------------------------------------
12
12
19 | val f3: (Cap^{c} -> Unit) => Unit = useCap3[Cap^{c}](c) // error
13
13
| ^^^^^^^^^^^^^^^^^^^
14
- | Cap^{c} -> Unit cannot be box-converted to box Cap^{c} ->{d, c} Unit
15
- | since the additional capture set {c} resulted from box conversion is not allowed in box Cap^{c} ->{d} Unit
14
+ | Cap^{c} -> Unit cannot be box-converted to box Cap^{c} ->{d, c} Unit
15
+ | since the additional capture set {c} resulting from box conversion is not allowed in box Cap^{c} ->{d} Unit
Original file line number Diff line number Diff line change 7
7
22 | val boxed1 : ((C^) => Unit) -> Unit = box1(c) // error
8
8
| ^^^^^^^
9
9
|C^ => Unit cannot be box-converted to box C{val arg: C^}^{c} ->{cap, c} Unit
10
- |since the additional capture set {c} resulted from box conversion is not allowed in box C{val arg: C^}^{c} => Unit
10
+ |since the additional capture set {c} resulting from box conversion is not allowed in box C{val arg: C^}^{c} => Unit
11
11
-- Error: tests/neg-custom-args/captures/i15772.scala:28:26 ------------------------------------------------------------
12
12
28 | val c : C^{x} = new C(x) // error
13
13
| ^
17
17
29 | val boxed2 : Observe[C^] = box2(c) // error
18
18
| ^^^^^^^
19
19
|C^ => Unit cannot be box-converted to box C{val arg: C^}^{c} ->{cap, c} Unit
20
- |since the additional capture set {c} resulted from box conversion is not allowed in box C{val arg: C^}^{c} => Unit
20
+ |since the additional capture set {c} resulting from box conversion is not allowed in box C{val arg: C^}^{c} => Unit
21
21
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i15772.scala:35:34 ---------------------------------------
22
22
35 | val boxed2 : Observe[C]^ = box2(c) // error
23
23
| ^
You can’t perform that action at this time.
0 commit comments