Re: [go-nuts] Another generics question

2023-02-18 Thread Jochen Voss
Thanks a lot! As an aside, the playgound is great. It made this conversation so much easier! All the best, Jochen On Saturday, 18 February 2023 at 01:31:16 UTC Ian Lance Taylor wrote: > On Fri, Feb 17, 2023 at 4:47 PM Jochen Voss wrote:, > > > > I would like to write a type constraint which m

Re: [go-nuts] Another generics question

2023-02-17 Thread Ian Lance Taylor
On Fri, Feb 17, 2023 at 4:47 PM Jochen Voss wrote:, > > I would like to write a type constraint which matches types like the > following: > > type v1 int > > func (obj v1) Add(other v1) v1 { > return obj + other > } > > type v2 string > > func (obj v2) Add(other v2) v2 { > return obj + o