Re: [go-nuts] generic function with a pointer parameter

2022-01-27 Thread Manlio Perillo
On Thu, Jan 27, 2022 at 9:57 PM Ian Lance Taylor wrote: > > On Thu, Jan 27, 2022 at 2:42 AM 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 e

Re: [go-nuts] generic function with a pointer parameter

2022-01-27 Thread Ian Lance Taylor
On Thu, Jan 27, 2022 at 2:42 AM 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 > > T

Re: [go-nuts] generic function with a pointer parameter

2022-01-27 Thread Jan Mercl
On Thu, Jan 27, 2022 at 11:42 AM Manlio Perillo wrote: > What is the reason why the code does not compile? I cannot answer your question, but just noting that this compiles and executes fine: https://gotipplay.golang.org/p/wveI2JzIxSr -- You received this message because you are subscribed to

[go-nuts] generic function with a pointer parameter

2022-01-27 Thread Manlio Perillo
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 *