Re: [go-nuts] Ambiguity in generic interfaces

2018-09-13 Thread Ian Lance Taylor
On Thu, Sep 13, 2018 at 6:31 PM, Patrick Smith wrote: > > (Apologies if this has already been brought up; I don't remember seeing it.) > > While writing a bit of sample generics code, I ran into a nasty little > ambiguity: > > type Foo(type T) interface {} > type Bar(type T) interface { > > Foo(T)

[go-nuts] Ambiguity in generic interfaces

2018-09-13 Thread Patrick Smith
(Apologies if this has already been brought up; I don't remember seeing it.) While writing a bit of sample generics code, I ran into a nasty little ambiguity: type Foo(type T) interface {} type Bar(type T) interface { Foo(T) } Does this embed the interface Foo(T) into Bar(T), or does it add t