What version of Go are you using (go version)?
go tip 1.18
$ go version
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
What did you do?
package main
import (
"fmt"
"reflect"
)
type A[T any] struct {
B[int]
}
type B[T any] struct {
}
func (b B[T]) Bat() {
t := new(T)
fmt.Println(reflect.TypeOf(t).String())
}
type Foo struct {
A[string]
}
func main() {
Foo{}.A.Bat()
Foo{}.A.B.Bat()
}
What did you expect to see?
What did you see instead?
What version of Go are you using (
go version)?go tip 1.18
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env)?go envOutputWhat did you do?
What did you expect to see?
What did you see instead?