mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
Revert "checker: warn on unused imported functions used via import math { sin, cos }
"
This reverts commit ddf0468f1c
.
This commit is contained in:
parent
61f91c263b
commit
b0d21db982
3 changed files with 0 additions and 16 deletions
|
@ -2853,9 +2853,6 @@ fn (mut c Checker) import_stmt(node ast.Import) {
|
||||||
if !func.is_pub {
|
if !func.is_pub {
|
||||||
c.error('module `${node.mod}` function `${sym.name}()` is private', sym.pos)
|
c.error('module `${node.mod}` function `${sym.name}()` is private', sym.pos)
|
||||||
}
|
}
|
||||||
if func.usages != 1 {
|
|
||||||
c.warn('module `${node.mod}` function `${sym.name}()` is unused', sym.pos)
|
|
||||||
}
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if _ := c.file.global_scope.find_const(name) {
|
if _ := c.file.global_scope.find_const(name) {
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
vlib/v/checker/tests/import_sym_fn_unused_warning_err.vv:1:15: warning: module `math` function `sin()` is unused
|
|
||||||
1 | import math { sin, cos }
|
|
||||||
| ~~~
|
|
||||||
2 |
|
|
||||||
3 | fn main() {}
|
|
||||||
vlib/v/checker/tests/import_sym_fn_unused_warning_err.vv:1:20: warning: module `math` function `cos()` is unused
|
|
||||||
1 | import math { sin, cos }
|
|
||||||
| ~~~
|
|
||||||
2 |
|
|
||||||
3 | fn main() {}
|
|
|
@ -1,3 +0,0 @@
|
||||||
import math { sin, cos }
|
|
||||||
|
|
||||||
fn main() {}
|
|
Loading…
Add table
Add a link
Reference in a new issue