Closed
Description
package main
type E[T any] struct {
A T
}
type T struct {
E[int]
}
func main() {
_ = T{E[int]{A: 1}}
//_ = T{E: E[int]{A: 1}} // <<< this should work
// manually it does work:
var x T
x.E = E[int]{A: 1}
}
We get an error:
./prog.go2:13: unknown field 'E' in struct literal of type T
yet when a T
is set up manually, the E
field is recognized.