File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
compiler/src/dotty/tools/dotc/cc
tests/neg-custom-args/captures Expand file tree Collapse file tree 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:
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 number Diff line number Diff line change 11-- Error: tests/neg-custom-args/captures/box-adapt-contra.scala:9:52 ---------------------------------------------------
229 | 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 --------------------------------------------------
7713 | 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 --------------------------------------------------
121219 | 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
Original file line number Diff line number Diff line change 7722 | 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 ------------------------------------------------------------
121228 | val c : C^{x} = new C(x) // error
1313 | ^
171729 | 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 ---------------------------------------
222235 | val boxed2 : Observe[C]^ = box2(c) // error
2323 | ^
You can’t perform that action at this time.
0 commit comments