How so? When you do
foo := foo.Foo{} foo.Bar() The compiler also has to look up Bar() for the type Foo, nothing special or difficult about that. In Go, the places where the compiler has to look are quite limited, I think. Furthermore with the currently proposed contracts, much the same lookup has to be done anyway. But if it tuns out a problem then we could limit it to interfaces + complex native types only, which will cover operators on those native types also. Op donderdag 18 oktober 2018 14:22:00 UTC+2 schreef Robert Engels: > > I think the problem with the proposal is that it is going to be very hard > for the compiler to know all of the operations a type can perform since for > concrete types the methods can be spread across multiple files. With an > interface it is only declared in a single location. > > -- 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.