-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Closed
Copy link
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Description
Opening a new issue for #50729 (comment) .
go/types is giving inconsistent errors with recursive aliases on this example https://go.dev/play/p/CO_3yd7yyrV :
type A = E[any]
type X interface {
G(c A)
}
type E[T any] interface {
L(A)
}
On the 1.22 playground this fails with the error:
./prog.go:12:4: invalid use of type alias A in recursive type (see go.dev/issue/50729)
Go build failed.
On the 1.23 playground, this fails with the error:
# [play]
vet: ./prog.go:12:4: invalid use of type alias A in recursive type (see go.dev/issue/50729)
Go vet failed.
Program exited.
gotip succeeds and outputs:
Program exited.
On 1.22 and 1.23, commenting out G(c A) makes the vet warning go away. As does moving the declaration of X below E.
cc @griesemer
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.