Closed
Description
This is a new version of frozen #39938. The following code
package p
type T0[P any] struct {
f P
}
type T1 struct { // <<< should get a cycle error here
_ T0[T1]
}
is invalid because T1
would expand indefinitely. The previous fix (https://golang.org/cl/240519) could lead to infinite sequences of instantiations (see #48951).
Correct solution of this problem requires some form of type flow analysis and is related to (and may be addressed with) #48098.