From https://github.com/golang/go/issues/46477#issuecomment-2175727569:
The following code snippet causes the Go compiler to panic (https://go.dev/play/p/PBvqgMjEs4S?v=gotip)
package main
type Seq[V any] = func(yield func(V) bool)
func f[E any](seq Seq[E]) {
return
}
func main() {
f(Seq[int](nil))
}
Marking for 1.23 in case it's a trivial oversight that we can easily address. But not a release blocker.
cc: @mdempsky for visibility. This looks like a noder issue.
Comment From: gabyhelp
Similar Issues
- cmd/compile: generics + constant cycle causes panic in type checker #52748
- cmd/compile: panic for cyclic generic interfaces #56045
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: Carrotman42
Possibly related to this minimal repro I was just devising:
package main
type OVal[O any] struct {}
type TVal[T any] = OVal[T]
var x TVal[bool]
func main() {}
The panic is the same index out of range [0] with length 0
message.
(sorry for the noise if not - I can file a new issue if desired)
Comment From: gopherbot
Change https://go.dev/cl/593715 mentions this issue: cmd/compile: support generic alias type
Comment From: gopherbot
Change https://go.dev/cl/593797 mentions this issue: [release-branch.go1.23] cmd/compile: support generic alias type