Skip to content

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

Closed

Description

@4ad

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.

Activity

  1. added this to the Go1.18 milestone on Aug 20, 2021
  2. added
    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
    on Aug 20, 2021
  3. mknyszek commented on Aug 20, 2021

    @mknyszek
    Contributor
  4. 4ad commented on Aug 20, 2021

    @4ad
    MemberAuthor

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

  5. mknyszek commented on Aug 20, 2021

    @mknyszek
    Contributor

    Closing as duplicate of #47796.

  6. locked and limited conversation to collaborators on Aug 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions