Hello Check this https://gotipplay.golang.org/p/d7nq2OV82Nv
On Thursday, January 27, 2022 at 12:12:50 PM UTC+1 manlio....@gmail.com wrote: > On Thursday, January 27, 2022 at 11:42:19 AM UTC+1 Manlio Perillo wrote: > >> Consider this example, adapted from >> https://github.com/golang/proposal/blob/master/design/43651-type-parameters.md#composite-types-in-constraints >> >> (note that the example is incorrect): >> https://gotipplay.golang.org/p/a8fHVTUpeie >> >> The compiler reports an error: >> ./prog.go:14:9: p.x undefined (type *T is pointer to type parameter, not >> type parameter) ./prog.go:16:4: p.x undefined (type *T is pointer to type >> parameter, not type parameter) >> >> What is the reason why the code does not compile? >> >> > Here is an alternate implementation: > https://gotipplay.golang.org/p/mGm8DkqkuAX > > The code **seems** reasonable, but the compiler reports an error: > ./prog.go:24:12: *MyStruct does not implement structField > > Thanks > Manlio > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/707492c4-640d-401e-a770-e91312fe5988n%40googlegroups.com.