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.

Reply via email to