Re: [go-nuts] [generics] A Channel of a Generic Structure

2020-06-18 Thread teivah
Cool, it does work, thanks! Btw, thank you guys for your work. I know there are a lot of discussions going on but personally I'm very happy with generics so far. I'll keep working on my migration. On Thursday, 18 June 2020 00:39:02 UTC+2, Ian Lance Taylor wrote: > > On Wed, Jun 17, 2020 at 2:37

Re: [go-nuts] [generics] A Channel of a Generic Structure

2020-06-17 Thread Ian Lance Taylor
On Wed, Jun 17, 2020 at 2:37 PM Harald Weidner wrote: > > > Here is the playground: https://go2goplay.golang.org/p/CVvUuNJVX-M > > I am unable to make this example to compile. > > This one compiles: > https://go2goplay.golang.org/p/2rmaCymukdv Thanks. I'm not sure why those parentheses are neede

Re: [go-nuts] [generics] A Channel of a Generic Structure

2020-06-17 Thread Harald Weidner
Hello, > Here is the playground: https://go2goplay.golang.org/p/CVvUuNJVX-M > I am unable to make this example to compile. This one compiles: https://go2goplay.golang.org/p/2rmaCymukdv Regards, Harald -- You received this message because you are subscribed to the Google Groups "golang-nuts" g

[go-nuts] [generics] A Channel of a Generic Structure

2020-06-17 Thread teivah . dev
Hello all, I'm working on implementing generics on a big container projet. So far, everything was good except for this very case: type Foo(type T) struct { v int } func (_ *Foo(T)) bar() int { elem := <-make(chan Foo(T)) return elem.v } *Foo* being a generic structure, I have a method