On Wed, 19 Oct 2016 08:40:51 -0700 (PDT) Viktor Kojouharov <vkojouha...@gmail.com> wrote:
[...] > > type Foo interface { > > func DoSomething() > > } > > > > func (f Foo) DoSomething() { > > } > > > > var f Foo > > > > f.DoSomething() > > > > How do you propose to distinguish these two DoSomething()-s? > > That's just a default method implementation. There's nothing > inherently confusing about what gets called. If a concrete > implementation exists, that gets called, otherwise the default one > does. But -- as I understood the original proposition -- these two methods would serve two completely different purposes: one operates on interface types; another one is doing something with a value of a concrete type implementing that interface. Am I not correct? If I'm correct that would be very confusing. -- 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.