Re: [go-nuts] Generics Draft: Mixing types and methods.

2019-08-03 Thread Steven Blenkinsop
On Sat, Aug 3, 2019 at 2:11 AM, Ian Lance Taylor wrote: > You're right, I wrote it wrong. Actually I'm not sure how to write that > contract. Ideally we want to say that T is either comparable or has the > Equal(T) bool method, but there is no way to write that. We can embed > comparable(T),

Re: [go-nuts] Generics Draft: Mixing types and methods.

2019-08-03 Thread Ian Lance Taylor
On Fri, Aug 2, 2019 at 9:25 PM Steven Blenkinsop wrote: > > On Fri, Aug 2, 2019 at 6:55 PM 'Axel Wagner' via golang-nuts > wrote: >> >> >> contract Comparable(T) { >> T comparable, Equal(T) bool >> } > > > Wait, does this work? I mean, `comparable` is a contract, but it's being used > as a