selective imports complain about "unused" module #22975
Labels
Bug
This tag is applied to issues which reports bugs.
Status: Confirmed
This bug has been confirmed to be valid by a contributor.
Unit: Compiler
Bugs/feature requests, that are related to the V compiler in general.
Unit: Parser
Bugs/feature requests, that are related to the V parser or syntax (*not* semantic ones).
Describe the bug
When I create a local module and selectively import something from it, v will complain about the module being imported but unused even though I selectively imported something from it. While this is technically true, it doesn't make much sense from a developer perspective, as using any publicly available code from the module should count as using the module.
Reproduction Steps
src/lib.v
:src/main.v
:v.mod
:Expected Behavior
I should not get a warning about the module being imported but unused when I use any code inside that module, as using that code should count as using the module.
Current Behavior
When doing
v run .
, I get the warning:Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.8 b801083
Environment details (OS name and version, etc.)
V full version: V 0.4.8 1931811.b801083
OS: linux, Ubuntu 24.10
Processor: 6 cpus, 64bit, little endian, Intel(R) Core(TM) i5-9400 CPU @ 2.90GHz
getwd: /home/henry/Projects/v/qbe
vexe: /home/henry/Projects/v/vcompiler/v
vexe mtime: 2024-11-25 18:10:30
vroot: OK, value: /home/henry/Projects/v/vcompiler
VMODULES: OK, value: /home/henry/.vmodules
VTMP: OK, value: /tmp/v_1000
Git version: git version 2.45.2
Git vroot status: b801083 (4 commit(s) behind V master)
.git/config present: true
CC version: cc (Ubuntu 14.2.0-4ubuntu2) 14.2.0
emcc version: N/A
thirdparty/tcc status: thirdparty-linux-amd64 0134e9b9
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: