Skip to content
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

x/tools/gopls: "unexpected type object" renaming type parameters #61635

Closed
findleyr opened this issue Jul 28, 2023 · 2 comments
Closed

x/tools/gopls: "unexpected type object" renaming type parameters #61635

findleyr opened this issue Jul 28, 2023 · 2 comments
Assignees
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@findleyr
Copy link
Contributor

findleyr commented Jul 28, 2023

Forked from #61614, where renaming type parameters doesn't work for valid code. I'll fix.

@findleyr findleyr self-assigned this Jul 28, 2023
@findleyr findleyr added this to the gopls/v0.13.1 milestone Jul 28, 2023
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jul 28, 2023
@findleyr
Copy link
Contributor Author

The example in question:

type builder[S ~[]F, F ~string] struct {
	name string
	elements S
	elemData map[F][]ElemData[F]
	// other fields...
}
type ElemData[F ~string] struct {
  Name F
  // other fields...
}
type BuilderImpl[S ~[]F, F ~string] struct{ builder[S, F] }

Renaming S->T works in a small package, but fails in a larger package (some sort of satisfy bug?), it works on a minimal package. Error message:

[Error - Received] 09:29:05.579 AM #83 regtest/marker.go:44:14: unexpected type object "type parameter S ~[]F" (please report a bug)

@findleyr findleyr changed the title x/tools/gopls: can't rename type parameters x/tools/gopls: can't rename type parameters when package is imported Jul 28, 2023
@gopherbot
Copy link

Change https://go.dev/cl/513916 mentions this issue: gopls/inernal/lsp/source: fix renaming of type parameters

@findleyr findleyr changed the title x/tools/gopls: can't rename type parameters when package is imported x/tools/gopls: "unexpected type object" renaming type parameters Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

2 participants