Under the generics draft, would this be allowed?

type Foo(type T) struct{}

func f(x Foo(int)) {}


I assume the answer is yes; I can't see any good reason to disallow it.

What about this?

func (x Foo(int)) Bar() {}


If this is allowed, does this now mean that Foo(int) implements

type Barrable interface {

Bar()

}


but that Foo(float64) does not implement Barrable?

What about this, where V is meant to be a type parameter, not a specific
type that was defined earlier in the code? (If allowed, it probably needs a
'type V' in it somewhere, but I'm not sure where to put that.)

func (x Foo([]V)) Bar() {}

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to