Re: [go-nuts] [generics] A Channel of a Generic Structure
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 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 needed. Filed > https://golang.org/issue/39670 to either fix the parser or update the > design draft. > > 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/6ede54c6-bd30-40b1-8027-6e25d21c0637o%40googlegroups.com.
Re: [go-nuts] [generics] A Channel of a Generic Structure
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 needed. Filed https://golang.org/issue/39670 to either fix the parser or update the design draft. 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/CAOyqgcWZauMmvg6pLB7tSBUu6xQiat2sdxDjPvfpyp3GQGrTag%40mail.gmail.com.
Re: [go-nuts] [generics] A Channel of a Generic Structure
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" 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/20200617213655.GB10193%40hweidner.de.
[go-nuts] [generics] A Channel of a Generic Structure
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 *bar* that has a *Foo* receiver (pointer or not, whatever). This methods has to create a channel of *Foo* and return the first *Foo.v* value from the channel (of course this example is stupid but this a reduction from a real use-case). Here is the playground: https://go2goplay.golang.org/p/CVvUuNJVX-M I am unable to make this example to compile. Do you guys have a solution? Cheers -- 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/de289917-4417-4ccc-b5e2-b2075b14d179o%40googlegroups.com.