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: generic base type like pointer or any struct #59518

Closed
someview opened this issue Apr 10, 2023 · 2 comments
Closed

x/tools/gopls: generic base type like pointer or any struct #59518

someview opened this issue Apr 10, 2023 · 2 comments
Labels
FrozenDueToAge 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

@someview
Copy link

gopls version

1.20.3

go env

win11

What did you do?

In other language like c#, the type constraints can be "class",but in go there is no "struct"
I have some situation need generic link this:
type gen[T anystruct]strcut{}
type gen[T *anystruct]{}
sync.pool[T any]

What did you expect to see?

[T anystruct] but not [T interface]
sync.pool[T any] but not sync.pool which return interface

@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 Apr 10, 2023
@gopherbot gopherbot added this to the Unreleased milestone Apr 10, 2023
@someview someview changed the title x/tools/gopls: generic base type like pointer or any strcut x/tools/gopls: generic base type like pointer or any struct Apr 10, 2023
@seankhliao
Copy link
Member

no, this isn't something we will do

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2023
@someview
Copy link
Author

no, this isn't something we will do

why?Is there some harmful?

@golang golang locked and limited conversation to collaborators Apr 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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

3 participants