Skip to content

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

@4ad

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.

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