| 1 | vlib/v/parser/tests/closure_not_declared.vv:4:9: error: `a` must be explicitly listed as inherited variable to be used inside a closure |
| 2 | 2 | a := 1 |
| 3 | 3 | f := fn () { |
| 4 | 4 | print(a) |
| 5 | | ^ |
| 6 | 5 | } |
| 7 | 6 | f() |
| 8 | Details: use `fn [a] () {` instead of `fn () {` |
| 9 | vlib/v/parser/tests/closure_not_declared.vv:4:3: error: `print` can not print void expressions |
| 10 | 2 | a := 1 |
| 11 | 3 | f := fn () { |
| 12 | 4 | print(a) |
| 13 | | ~~~~~~~~ |
| 14 | 5 | } |
| 15 | 6 | f() |
| 16 | vlib/v/parser/tests/closure_not_declared.vv:4:9: error: undefined ident: `a` |
| 17 | 2 | a := 1 |
| 18 | 3 | f := fn () { |
| 19 | 4 | print(a) |
| 20 | | ^ |
| 21 | 5 | } |
| 22 | 6 | f() |
| 23 |