Skip to content

Commit c1f44c4

Browse files
committedMar 13, 2025
Fix typo in error message
1 parent 94765e7 commit c1f44c4

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed
 

‎compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1458,7 +1458,7 @@ class CheckCaptures extends Recheck, SymTransformer:
14581458
then
14591459
report.error(
14601460
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)
14621462
cs
14631463

14641464
def adaptedType(resultBoxed: Boolean) =
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
-- Error: tests/neg-custom-args/captures/box-adapt-contra.scala:9:52 ---------------------------------------------------
22
9 | val f: (Cap^{c} -> Unit) -> Unit = useCap[Cap^{c}](c) // error
33
| ^^^^^^^^^^^^^^^^^^
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
66
-- Error: tests/neg-custom-args/captures/box-adapt-contra.scala:13:57 --------------------------------------------------
77
13 | val f1: (Cap^{c} => Unit) ->{c} Unit = useCap1[Cap^{c}](c) // error, was ok when cap was a root
88
| ^^^^^^^^^^^^^^^^^^^
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
1111
-- Error: tests/neg-custom-args/captures/box-adapt-contra.scala:19:54 --------------------------------------------------
1212
19 | val f3: (Cap^{c} -> Unit) => Unit = useCap3[Cap^{c}](c) // error
1313
| ^^^^^^^^^^^^^^^^^^^
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

‎tests/neg-custom-args/captures/i15772.check

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
22 | val boxed1 : ((C^) => Unit) -> Unit = box1(c) // error
88
| ^^^^^^^
99
|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
1111
-- Error: tests/neg-custom-args/captures/i15772.scala:28:26 ------------------------------------------------------------
1212
28 | val c : C^{x} = new C(x) // error
1313
| ^
@@ -17,7 +17,7 @@
1717
29 | val boxed2 : Observe[C^] = box2(c) // error
1818
| ^^^^^^^
1919
|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
2121
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/i15772.scala:35:34 ---------------------------------------
2222
35 | val boxed2 : Observe[C]^ = box2(c) // error
2323
| ^

0 commit comments

Comments
 (0)