x/tools/gopls: spurious "would shadow" error when renaming parameter #57479
Labels
gopls
Issues related to the Go language server, gopls.
Refactoring
Issues related to refactoring tools
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
When renaming a parameter using gopls's rename command, and the new name is identical to the name of an imported package referenced by one of the function parameters, gopls reports an error, even though the renaming might be sound. For example:
(Unfortunately the pronouns in the error message don't actually link to source locations, at least not when I use Emacs+eglot.)
The same thing happens when the package is referenced by a later parameter (e.g.
func(x int, y fmt.Stringer)
) or by a named constant in an array type (e.g.func(x [math.MaxInt]bool)
).IIRC the gorename tool got this right.
The text was updated successfully, but these errors were encountered: