Closed
Description
I also got the same error. MWE of the code I was working with:
package main
import "fmt"
type Interface[K any] interface {
Name() string
}
type interfaceImpl[K any] struct {
name string
}
func (i interfaceImpl[K]) Name() string {
return i.name
}
type Type[T any, K any] struct {
interfaceImpl[K]
}
func main() {
a := Type[int, int]{
interfaceImpl[int]{name: "hello"},
}
printName(a)
}
func printName[T any](k Type[T, int]) {
fmt.Println(k.Name())
}
Originally posted by @arvidfm in #53254 (comment)