|
1 |
| --- Error: tests/neg-custom-args/captures/usingLogFile.scala:23:27 ------------------------------------------------------ |
2 |
| -23 | val later = usingLogFile { f => () => f.write(0) } // error |
3 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
4 |
| - | {f} () -> Unit cannot be box-converted to box ? () -> Unit |
5 |
| - | since one of their capture sets contains the root capability `*` |
6 |
| --- Error: tests/neg-custom-args/captures/usingLogFile.scala:29:9 ------------------------------------------------------- |
7 |
| -29 | later2.x() // error |
8 |
| - | ^^^^^^^^ |
9 |
| - | The expression's type box {*} () -> Unit is not allowed to capture the root capability `*`. |
10 |
| - | This usually means that a capability persists longer than its allowed lifetime. |
11 | 1 | -- Error: tests/neg-custom-args/captures/usingLogFile.scala:33:2 -------------------------------------------------------
|
12 | 2 | 33 | later3() // error
|
13 | 3 | | ^^^^^^
|
|
18 | 8 | | ^^^^^^^^
|
19 | 9 | | The expression's type box {*} () -> Unit is not allowed to capture the root capability `*`.
|
20 | 10 | | This usually means that a capability persists longer than its allowed lifetime.
|
21 |
| --- Error: tests/neg-custom-args/captures/usingLogFile.scala:47:27 ------------------------------------------------------ |
| 11 | +-- Error: tests/neg-custom-args/captures/usingLogFile.scala:23:6 ------------------------------------------------------- |
| 12 | +23 | val later = usingLogFile { f => () => f.write(0) } // error |
| 13 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 14 | + | Non-local value later cannot have an inferred type |
| 15 | + | {x$0} () -> Unit |
| 16 | + | with non-empty capture set {x$0}. |
| 17 | + | The type needs to be declared explicitly. |
| 18 | +-- Error: tests/neg-custom-args/captures/usingLogFile.scala:29:9 ------------------------------------------------------- |
| 19 | +29 | later2.x() // error |
| 20 | + | ^^^^^^^^ |
| 21 | + | The expression's type box {x$0, *} () -> Unit is not allowed to capture the root capability `*`. |
| 22 | + | This usually means that a capability persists longer than its allowed lifetime. |
| 23 | +-- Error: tests/neg-custom-args/captures/usingLogFile.scala:47:6 ------------------------------------------------------- |
22 | 24 | 47 | val later = usingLogFile { f => () => f.write(0) } // error
|
23 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^ |
24 |
| - | {f} () -> Unit cannot be box-converted to box ? () -> Unit |
25 |
| - | since one of their capture sets contains the root capability `*` |
26 |
| --- Error: tests/neg-custom-args/captures/usingLogFile.scala:62:33 ------------------------------------------------------ |
| 25 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 26 | + | Non-local value later cannot have an inferred type |
| 27 | + | {x$0} () -> Unit |
| 28 | + | with non-empty capture set {x$0}. |
| 29 | + | The type needs to be declared explicitly. |
| 30 | +-- Error: tests/neg-custom-args/captures/usingLogFile.scala:62:25 ------------------------------------------------------ |
27 | 31 | 62 | val later = usingFile("out", f => (y: Int) => xs.foreach(x => f.write(x + y))) // error
|
28 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
29 |
| - | {f} (x$0: Int) -> Unit cannot be box-converted to box ? (x$0: Int) -> Unit |
30 |
| - | since one of their capture sets contains the root capability `*` |
31 |
| --- Error: tests/neg-custom-args/captures/usingLogFile.scala:71:37 ------------------------------------------------------ |
| 32 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 33 | + | The expression's type box {x$0, *} (x$0: Int) -> Unit is not allowed to capture the root capability `*`. |
| 34 | + | This usually means that a capability persists longer than its allowed lifetime. |
| 35 | +-- Error: tests/neg-custom-args/captures/usingLogFile.scala:71:25 ------------------------------------------------------ |
32 | 36 | 71 | val later = usingFile("logfile", usingLogger(_, l => () => l.log("test"))) // error
|
33 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
34 |
| - | {_$1} () -> Unit cannot be box-converted to box ? () -> Unit |
35 |
| - | since one of their capture sets contains the root capability `*` |
| 37 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 38 | + | The expression's type box {x$0, *} () -> Unit is not allowed to capture the root capability `*`. |
| 39 | + | This usually means that a capability persists longer than its allowed lifetime. |
0 commit comments