v2 / vlib / v / parser / tests / closure_not_declared.out
22 lines · 22 sloc · 726 bytes · d7cc5c8877a8f2339495b7d2c2031c2d833c93d7
Raw
1vlib/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()
8Details: use `fn [a] () {` instead of `fn () {`
9vlib/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()
16vlib/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