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).
I am unable to make this example to compile.
Do you guys have a solution?
Cheers