Revert "checker: warn on unused imported functions used via import math { sin, cos }"

This reverts commit ddf0468f1c.
This commit is contained in:
Swastik 2023-11-02 19:50:42 +05:30
parent 61f91c263b
commit b0d21db982
3 changed files with 0 additions and 16 deletions

View file

@ -2853,9 +2853,6 @@ fn (mut c Checker) import_stmt(node ast.Import) {
if !func.is_pub {
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
}
if _ := c.file.global_scope.find_const(name) {

View file

@ -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() {}

View file

@ -1,3 +0,0 @@
import math { sin, cos }
fn main() {}