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

cmd/compile: "F is not a generic type" when F is a recursive generic interface #47836

Closed
4ad opened this issue Aug 20, 2021 · 4 comments
Closed
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@4ad
Copy link
Member

4ad commented Aug 20, 2021

On tip (e9e0d1e) with -gcflags=-G=3

Repro:

package p

type F[t F[t]] interface {}

Compiler rejects it with:

go build -gcflags=-G=3 j.go
# command-line-arguments
./j.go:3:10: F is not a generic type

However, it accepts this:

package p

type F[t F] interface {}

But that has other problems, see #47837.

@mknyszek mknyszek added this to the Go1.18 milestone Aug 20, 2021
@mknyszek mknyszek added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 20, 2021
@mknyszek
Copy link
Contributor

CC @ianlancetaylor @griesemer

@tdakkota
Copy link

Seems like duplicate of #47796

@4ad
Copy link
Member Author

4ad commented Aug 20, 2021

Yep, seems like a dupe. In fact, I was trying to write that exact Eq when I found this.

@mknyszek
Copy link
Contributor

Closing as duplicate of #47796.

@golang golang locked and limited conversation to collaborators Aug 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants