-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vfmt removes selective import of interface when used only in implements clause #22200
Labels
Bug
This tag is applied to issues which reports bugs.
Comments
Actually there might be 2 separate issues.
For the second one if I do: struct Walker implements Abcdef {
aaa string
} Compiler does not complain that Abcdef type is not recognized, but continues with normal compilation. |
Will fix today. |
I've reopened it, since #22209 fixes only the formatting issue, not the interface existence one. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
V fmt removes selective imports of an interface when a given interface is used only in implements clause.
The compiler will not complain after formatting, but I'm puzzled how compiler knows where the symbol 'Visitor' comes from as it does not contain qualifier nor such symbol exists in local scope. Might be that this is not checked.
Reproduction Steps
Given:
Run
v fmt
on itExpected Behavior
Selective import not removed.
Current Behavior
First line will be transformed to
import v.ast.walker
.Possible Solution
No response
Additional Information/Context
No response
V version
V 0.4.7 79bedff
Environment details (OS name and version, etc.)
V full version: V 0.4.7 a7db095.79bedff
OS: linux, Linux Mint 21.3
Processor: 20 cpus, 64bit, little endian, 12th Gen Intel(R) Core(TM) i9-12900H
getwd: /home/jakub/repos/V-ConsoleTest
vexe: /home/jakub/programy/v/v
vexe mtime: 2024-09-11 21:12:09
vroot: OK, value: /home/jakub/programy/v
VMODULES: OK, value: /home/jakub/.vmodules
VTMP: OK, value: /tmp/v_1000
Git version: git version 2.34.1
Git vroot status: weekly.2024.36-42-g79bedff1
.git/config present: true
CC version: cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
thirdparty/tcc status: thirdparty-linux-amd64 a0799a5
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: