x/tools/gopls: rename fails with "conflicts with var in same block" when the new identifier already exists #41852
Labels
FeatureRequest
gopls
Issues related to the Go language server, gopls.
help wanted
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
This is related to (but slightly different from) #41851.
What did you do?
Follow the same steps to reproduce as for #41851, but for step (1) use a declared identifier instead of an undeclared one.
(https://play.golang.org/p/_L1Lkry0R0o)
What did you expect to see?
The identifier at the point, as well as all references to it, should be renamed, despite the fact that the new identifier conflicts with the existing declaration.
The resulting program should now have a
redeclared in this block
error (https://play.golang.org/p/IP2ZkF7qnIe), which the user may resolve by removing one or the other of the conflicting declarations.What did you see instead?
The text was updated successfully, but these errors were encountered: