|
5 | 5 | | Required: () -> Unit
|
6 | 6 | |
|
7 | 7 | | longer explanation available when compiling with `-explain`
|
8 |
| --- Error: tests/neg-custom-args/captures/vars.scala:13:6 --------------------------------------------------------------- |
9 |
| -13 | var a: String => String = f // error |
10 |
| - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
11 |
| - | The mutable variable's type box {*} String -> String is not allowed to capture the root capability `*`. |
12 |
| - | This usually means that a capability persists longer than its allowed lifetime. |
13 |
| --- Error: tests/neg-custom-args/captures/vars.scala:15:4 --------------------------------------------------------------- |
14 |
| -15 | b.head // error |
| 8 | +-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/vars.scala:15:10 ----------------------------------------- |
| 9 | +15 | val u = a // error |
| 10 | + | ^ |
| 11 | + | Found: (a : box {*} String -> String) |
| 12 | + | Required: {*} (x$0: ? String) -> ? String |
| 13 | + | |
| 14 | + | longer explanation available when compiling with `-explain` |
| 15 | +-- Error: tests/neg-custom-args/captures/vars.scala:16:2 --------------------------------------------------------------- |
| 16 | +16 | a("") // error |
| 17 | + | ^ |
| 18 | + | box {*} String -> String cannot be box-converted to a type that can be selected or applied |
| 19 | + | since one of their capture sets contains the root capability `*` |
| 20 | +-- Error: tests/neg-custom-args/captures/vars.scala:17:4 --------------------------------------------------------------- |
| 21 | +17 | b.head // error |
15 | 22 | | ^^^^^^
|
16 | 23 | | The expression's type box {*} String -> String is not allowed to capture the root capability `*`.
|
17 | 24 | | This usually means that a capability persists longer than its allowed lifetime.
|
18 |
| --- Error: tests/neg-custom-args/captures/vars.scala:30:8 --------------------------------------------------------------- |
19 |
| -30 | local { cap3 => // error |
| 25 | +-- Error: tests/neg-custom-args/captures/vars.scala:32:8 --------------------------------------------------------------- |
| 26 | +32 | local { cap3 => // error |
20 | 27 | | ^
|
21 | 28 | | The expression's type box {*} (x$0: ? String) -> ? String is not allowed to capture the root capability `*`.
|
22 | 29 | | This usually means that a capability persists longer than its allowed lifetime.
|
23 |
| -31 | def g(x: String): String = if cap3 == cap3 then "" else "a" |
24 |
| -32 | g |
25 |
| -33 | } |
| 30 | +33 | def g(x: String): String = if cap3 == cap3 then "" else "a" |
| 31 | +34 | g |
| 32 | +35 | } |
0 commit comments