On Thu, Jan 27, 2022 at 2:42 AM Manlio Perillo <manlio.peri...@gmail.com> 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?

It probably should and eventually will compile.  There are a lot of
corner cases about structural constraints.  Do not expect them all to
be sorted out in the 1.18 release.

Is there any practical use for this or are you just curious?

Ian

-- 
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/CAOyqgcUTtV-awE00c3CMOkb4OgabHz4KecjsmHB3WYtBxndLVw%40mail.gmail.com.

Reply via email to