-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all: do not warn/error for
import flag as _
- Loading branch information
Showing
10 changed files
with
29 additions
and
12 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
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,6 @@ | ||
vlib/v/checker/tests/import_unused_warning.vv:1:8: warning: module 'time' is imported but never used | ||
1 | import time | ||
vlib/v/checker/tests/import_unused_warning.vv:2:8: warning: module 'time' is imported but never used | ||
1 | import os as _ | ||
2 | import time | ||
| ~~~~ | ||
2 | fn main() { | ||
3 | println('hello, world') | ||
3 | | ||
4 | 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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
import os as _ | ||
import time | ||
|
||
fn main() { | ||
println('hello, world') | ||
} |
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,3 +1,10 @@ | ||
vlib/v/checker/tests/incorrect_name_module.vv:4:8: warning: module 'os' is imported but never used | ||
2 | | ||
3 | import math as _ | ||
4 | import os | ||
| ~~ | ||
vlib/v/checker/tests/incorrect_name_module.vv:1:1: error: module name `_A` cannot start with `_` | ||
1 | module _A | ||
| ~~~~~~~~~ | ||
| ~~~~~~~~~ | ||
2 | | ||
3 | import math as _ |
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 +1,4 @@ | ||
module _A | ||
|
||
import math as _ | ||
import os |
6 changes: 3 additions & 3 deletions
6
vlib/v/checker/tests/modules/module_alias_started_with_underscore.out
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,7 @@ | ||
vlib/v/checker/tests/modules/module_alias_started_with_underscore/main.v:3:1: error: module alias `_` cannot start with `_` | ||
vlib/v/checker/tests/modules/module_alias_started_with_underscore/main.v:3:1: error: module alias `_abc` cannot start with `_` | ||
1 | module main | ||
2 | | ||
3 | import underscore as _ | ||
| ~~~~~~~~~~~~~~~~~~~~~~ | ||
3 | import underscore as _abc | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
4 | | ||
5 | fn main() { |
4 changes: 2 additions & 2 deletions
4
vlib/v/checker/tests/modules/module_alias_started_with_underscore/main.v
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,7 @@ | ||
module main | ||
|
||
import underscore as _ | ||
import underscore as _abc | ||
|
||
fn main() { | ||
_.foo() | ||
_abc.foo() | ||
} |
3 changes: 3 additions & 0 deletions
3
vlib/v/gen/c/testdata/unused_import_aliased_as_underscore.c.must_have
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,3 @@ | ||
struct flag__Flag { | ||
println(flag__FlagParser_usage(fs)); | ||
void flag__FlagParser_footer(flag__FlagParser* fs, string footer) { |
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 @@ | ||
import flag as _ |
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