| 1 | vlib/v/checker/tests/var_duplicate_const.vv:4:5: warning: duplicate of a const name `size` |
| 2 | 2 | |
| 3 | 3 | fn main() { |
| 4 | 4 | size := 11 |
| 5 | | ~~~~ |
| 6 | 5 | println(main.size) |
| 7 | 6 | } |
| 8 | vlib/v/checker/tests/var_duplicate_const.vv:4:5: warning: unused variable: `size` |
| 9 | 2 | |
| 10 | 3 | fn main() { |
| 11 | 4 | size := 11 |
| 12 | | ~~~~ |
| 13 | 5 | println(main.size) |
| 14 | 6 | } |
| 15 | vlib/v/checker/tests/var_duplicate_const.vv:1:7: notice: unused constant: `size` |
| 16 | 1 | const size = 22 |
| 17 | | ~~~~~~~~~ |
| 18 | 2 | |
| 19 | 3 | fn main() { |
| 20 | ================== C compilation error (from cc): ============== |
| 21 | cc: /tmp/v_502/var_duplicate_const.01KNN5X7W4MVH2B58E9FG5GJKE.tmp.c:2139:36: error: use of undeclared identifier 'size' |
| 22 | cc: 2139 | builtin__println(builtin__int_str(size)); |
| 23 | cc: | ^ |
| 24 | cc: 1 error generated. |
| 25 | ================================================================ |
| 26 | Try passing `-g` when compiling, to see a .v file:line information, that correlates more with the C error. |
| 27 | (Alternatively, pass `-show-c-output`, to print the full C error message). |
| 28 | builder error: |
| 29 | ================== |
| 30 | C error found while compiling generated C code. |
| 31 | This can be caused by invalid C interop code, C compiler flags, or a V compiler bug. |
| 32 | If your code is pure V and this still happens, please report it using `v bug file.v`, |
| 33 | or goto https://github.com/vlang/v/issues/new/choose . |
| 34 | You can also use #help on Discord: https://discord.gg/vlang . |
| 35 | |