Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parser: fix case of falsely registering imports as used, remove unuse…
…d imports (#21156)
- Loading branch information
Showing
22 changed files
with
100 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
module anim | ||
|
||
import benchmark | ||
import sim | ||
import sim.img | ||
|
||
fn pixels_worker(mut app App) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import sokol | ||
import sokol.sapp | ||
import sokol.gfx | ||
import sokol.sgl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import sokol | ||
import sokol.sapp | ||
import sokol.gfx | ||
import sokol.sgl | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
module big | ||
|
||
import math | ||
import math.bits | ||
|
||
// suppose operand_a bigger than operand_b and both not null. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ module cbuilder | |
|
||
import os | ||
import time | ||
import sync | ||
import v.util | ||
import v.builder | ||
import sync.pool | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ module builder | |
|
||
import os | ||
import time | ||
import v.pref | ||
import v.util | ||
import v.cflag | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
module checker | ||
|
||
import v.ast | ||
import v.pref | ||
import v.util | ||
import v.token | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,98 +1,98 @@ | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:5:13: error: mismatched types `Aaa` and `int literal` | ||
3 | struct Aaa{} | ||
4 | fn main() { | ||
5 | println(Aaa{} * 10) | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:4:13: error: mismatched types `Aaa` and `int literal` | ||
2 | struct Aaa{} | ||
3 | fn main() { | ||
4 | println(Aaa{} * 10) | ||
| ~~~~~~~~~~ | ||
6 | println(10 * Aaa{}) | ||
7 | println([1,2,3] * 10) | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:5:13: error: infix expr: cannot use `int literal` (right expression) as `Aaa` | ||
3 | struct Aaa{} | ||
4 | fn main() { | ||
5 | println(Aaa{} * 10) | ||
5 | println(10 * Aaa{}) | ||
6 | println([1,2,3] * 10) | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:4:13: error: infix expr: cannot use `int literal` (right expression) as `Aaa` | ||
2 | struct Aaa{} | ||
3 | fn main() { | ||
4 | println(Aaa{} * 10) | ||
| ~~~~~~~~~~ | ||
6 | println(10 * Aaa{}) | ||
7 | println([1,2,3] * 10) | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:6:13: error: mismatched types `int literal` and `Aaa` | ||
4 | fn main() { | ||
5 | println(Aaa{} * 10) | ||
6 | println(10 * Aaa{}) | ||
5 | println(10 * Aaa{}) | ||
6 | println([1,2,3] * 10) | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:5:13: error: mismatched types `int literal` and `Aaa` | ||
3 | fn main() { | ||
4 | println(Aaa{} * 10) | ||
5 | println(10 * Aaa{}) | ||
| ~~~~~~~~~~ | ||
7 | println([1,2,3] * 10) | ||
8 | println(10 * [1,2,3]) | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:6:13: error: infix expr: cannot use `Aaa` (right expression) as `int literal` | ||
4 | fn main() { | ||
5 | println(Aaa{} * 10) | ||
6 | println(10 * Aaa{}) | ||
6 | println([1,2,3] * 10) | ||
7 | println(10 * [1,2,3]) | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:5:13: error: infix expr: cannot use `Aaa` (right expression) as `int literal` | ||
3 | fn main() { | ||
4 | println(Aaa{} * 10) | ||
5 | println(10 * Aaa{}) | ||
| ~~~~~~~~~~ | ||
7 | println([1,2,3] * 10) | ||
8 | println(10 * [1,2,3]) | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:7:13: error: mismatched types `[]int` and `int literal` | ||
5 | println(Aaa{} * 10) | ||
6 | println(10 * Aaa{}) | ||
7 | println([1,2,3] * 10) | ||
6 | println([1,2,3] * 10) | ||
7 | println(10 * [1,2,3]) | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:6:13: error: mismatched types `[]int` and `int literal` | ||
4 | println(Aaa{} * 10) | ||
5 | println(10 * Aaa{}) | ||
6 | println([1,2,3] * 10) | ||
| ~~~~~~~~~~~~ | ||
8 | println(10 * [1,2,3]) | ||
9 | a := map[string]int | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:7:13: error: infix expr: cannot use `int literal` (right expression) as `[]int` | ||
5 | println(Aaa{} * 10) | ||
6 | println(10 * Aaa{}) | ||
7 | println([1,2,3] * 10) | ||
7 | println(10 * [1,2,3]) | ||
8 | a := map[string]int | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:6:13: error: infix expr: cannot use `int literal` (right expression) as `[]int` | ||
4 | println(Aaa{} * 10) | ||
5 | println(10 * Aaa{}) | ||
6 | println([1,2,3] * 10) | ||
| ~~~~~~~~~~~~ | ||
8 | println(10 * [1,2,3]) | ||
9 | a := map[string]int | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:8:13: error: mismatched types `int literal` and `[]int` | ||
6 | println(10 * Aaa{}) | ||
7 | println([1,2,3] * 10) | ||
8 | println(10 * [1,2,3]) | ||
7 | println(10 * [1,2,3]) | ||
8 | a := map[string]int | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:7:13: error: mismatched types `int literal` and `[]int` | ||
5 | println(10 * Aaa{}) | ||
6 | println([1,2,3] * 10) | ||
7 | println(10 * [1,2,3]) | ||
| ~~~~~~~~~~~~ | ||
9 | a := map[string]int | ||
10 | println(a * 10) | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:8:13: error: infix expr: cannot use `[]int` (right expression) as `int literal` | ||
6 | println(10 * Aaa{}) | ||
7 | println([1,2,3] * 10) | ||
8 | println(10 * [1,2,3]) | ||
8 | a := map[string]int | ||
9 | println(a * 10) | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:7:13: error: infix expr: cannot use `[]int` (right expression) as `int literal` | ||
5 | println(10 * Aaa{}) | ||
6 | println([1,2,3] * 10) | ||
7 | println(10 * [1,2,3]) | ||
| ~~~~~~~~~~~~ | ||
9 | a := map[string]int | ||
10 | println(a * 10) | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:10:13: error: mismatched types `map[string]int` and `int literal` | ||
8 | println(10 * [1,2,3]) | ||
9 | a := map[string]int | ||
10 | println(a * 10) | ||
8 | a := map[string]int | ||
9 | println(a * 10) | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:9:13: error: mismatched types `map[string]int` and `int literal` | ||
7 | println(10 * [1,2,3]) | ||
8 | a := map[string]int | ||
9 | println(a * 10) | ||
| ~~~~~~ | ||
11 | println(10 * a) | ||
12 | c1 := cmplx.complex(1,-2) | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:10:13: error: infix expr: cannot use `int literal` (right expression) as `map[string]int` | ||
8 | println(10 * [1,2,3]) | ||
9 | a := map[string]int | ||
10 | println(a * 10) | ||
10 | println(10 * a) | ||
11 | c1 := cmplx.complex(1,-2) | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:9:13: error: infix expr: cannot use `int literal` (right expression) as `map[string]int` | ||
7 | println(10 * [1,2,3]) | ||
8 | a := map[string]int | ||
9 | println(a * 10) | ||
| ~~~~~~ | ||
11 | println(10 * a) | ||
12 | c1 := cmplx.complex(1,-2) | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:11:13: error: mismatched types `int literal` and `map[string]int` | ||
9 | a := map[string]int | ||
10 | println(a * 10) | ||
11 | println(10 * a) | ||
10 | println(10 * a) | ||
11 | c1 := cmplx.complex(1,-2) | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:10:13: error: mismatched types `int literal` and `map[string]int` | ||
8 | a := map[string]int | ||
9 | println(a * 10) | ||
10 | println(10 * a) | ||
| ~~~~~~ | ||
12 | c1 := cmplx.complex(1,-2) | ||
13 | c2 := c1 * 2.0 | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:11:13: error: infix expr: cannot use `map[string]int` (right expression) as `int literal` | ||
9 | a := map[string]int | ||
10 | println(a * 10) | ||
11 | println(10 * a) | ||
11 | c1 := cmplx.complex(1,-2) | ||
12 | c2 := c1 * 2.0 | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:10:13: error: infix expr: cannot use `map[string]int` (right expression) as `int literal` | ||
8 | a := map[string]int | ||
9 | println(a * 10) | ||
10 | println(10 * a) | ||
| ~~~~~~ | ||
12 | c1 := cmplx.complex(1,-2) | ||
13 | c2 := c1 * 2.0 | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:13:8: error: infix expr: cannot use `float literal` (right expression) as `math.complex.Complex` | ||
11 | println(10 * a) | ||
12 | c1 := cmplx.complex(1,-2) | ||
13 | c2 := c1 * 2.0 | ||
11 | c1 := cmplx.complex(1,-2) | ||
12 | c2 := c1 * 2.0 | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:12:8: error: infix expr: cannot use `float literal` (right expression) as `math.complex.Complex` | ||
10 | println(10 * a) | ||
11 | c1 := cmplx.complex(1,-2) | ||
12 | c2 := c1 * 2.0 | ||
| ~~~~~~~~ | ||
14 | println(c2) | ||
15 | c3 := 2.0 * c1 | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:15:8: error: infix expr: cannot use `math.complex.Complex` (right expression) as `float literal` | ||
13 | c2 := c1 * 2.0 | ||
14 | println(c2) | ||
15 | c3 := 2.0 * c1 | ||
13 | println(c2) | ||
14 | c3 := 2.0 * c1 | ||
vlib/v/checker/tests/mul_op_wrong_type_err.vv:14:8: error: infix expr: cannot use `math.complex.Complex` (right expression) as `float literal` | ||
12 | c2 := c1 * 2.0 | ||
13 | println(c2) | ||
14 | c3 := 2.0 * c1 | ||
| ~~~~~~~~ | ||
16 | println(c3) | ||
17 | } | ||
15 | println(c3) | ||
16 | } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import math | ||
import math.complex as cmplx | ||
struct Aaa{} | ||
fn main() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
vlib/v/checker/tests/unused_import_err.vv:1:8: warning: module 'te (term)' is imported but never used | ||
1 | import term as te | ||
| ~~~~ | ||
2 | import te.ui | ||
vlib/v/checker/tests/unused_import_err.vv:2:8: warning: module 'ui (te.ui)' is imported but never used | ||
1 | import term as te | ||
2 | import te.ui | ||
| ~~~~~ | ||
vlib/v/checker/tests/unused_import_err.vv:2:1: builder error: cannot import module "te.ui" (not found) | ||
1 | import term as te | ||
2 | import te.ui | ||
| ~~~~~~~~~~~~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import term as te | ||
import te.ui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import net.http | ||
import os | ||
import time | ||
import x.sessions | ||
import x.vweb | ||
|