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?

: internal compiler error: panic: /usr/local/go/src/cmd/compile/internal/types2/subst.go:56: assertion failed

etc.

What did you expect to see?

no panic

Comment From: gabyhelp

Related Issues and Documentation

(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