Go version
1.23rc1
Output of go env
in your module/workspace:
n/a
What did you do?
https://go.dev/play/p/kMvT8_f91aK?v=gotip
What did you see happen?
etc.
What did you expect to see?
no panic
Comment From: gabyhelp
Related Issues and Documentation
- cmd/compile: compile panics with generic type alias #68526
- cmd/compile: panic for cyclic generic interfaces #56045
- go/types,types2: internal compiler error: panic: cmd/compile/internal/types2/check.go:595: assertion failed #66878 (closed)
- cmd/compile: internal compiler error importing a recursive type (recursive through a type constraint) #51219 (closed)
- cmd/compile: internal compiler error: panic: builtins.go: assertion failed #61486 (closed)
- cmd/compile: compiler panic for generic alias type #68054 (closed)
- cmd/compile: assertion failure in validType test [go1.23] #66323 (closed)
- cmd/compile: generics + constant cycle causes panic in type checker #52748 (closed)
- cmd/compile/internal/types2: panic when type function selector is not instantiated #48048 (closed)
- cmd/compile: crash while exporting aliases (with GODEBUG=gotypesalias=1) #66550 (closed)
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: ianlancetaylor
CC @griesemer @timothy-king
Comment From: griesemer
Reproduced at 1.23rc2. Interestingly, the code typechecks fine when checked by the typechecker alone.
Comment From: timothy-king
Reduced example: https://go.dev/play/p/X9GxAbUdgeA?v=gotip
Comment From: griesemer
Simpler reproducer (link):
package main
type A[P any] = struct{ _ P }
type N[P any] A[P]
func f[P any](N[P]) {}
var _ = f[int]
Comment From: gopherbot
Change https://go.dev/cl/601115 mentions this issue: types2, go/types: fix instantiation of named type with generic alias
Comment From: cuonglm
@griesemer Do we need to backport this to 1.23?
Comment From: cuonglm
@gopherbot please backport this issue to go1.23
Comment From: gopherbot
Backport issue(s) opened: #68608 (for 1.23).
Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://go.dev/wiki/MinorReleases.
Comment From: griesemer
@cuonglm Yes, we should backport this. I believe an issue is not needed per @dmitshur 's e-mail:
Any CLs that land after CL 600176 ("internal/goversion: update Version to 1.24") but target Go 1.23 must be cherry-picked to release-branch.go1.23. Cherry-pick CLs can be created following the same steps as usual but do not need a backport issue or approval from the release team. Please continue to use your judgment about what should be included this late in the Go 1.23 release cycle.
Comment From: gopherbot
Change https://go.dev/cl/601116 mentions this issue: [release-branch.go1.23] types2, go/types: fix instantiation of named type with generic alias