On Saturday, December 10, 2016 at 6:47:43 PM UTC+8, Jan Mercl wrote: > > > > I know this. > > But the spec says a method M defined for type T is also a method of *T. > > In fact, it is not accurate. T.M and (*T).M have different signatures. > > Please cite the part of the specs > > I don't think the specs say that because it's technically impossible, you > have above correctly stated why. What the specs talk about are the methods > sets and that one method sets is s superset set of the other. Which is a > completely different thing. Elsewhere in the specs you can find that when > calling a pointer-receiver method on a value the compiler will make ones's > life easier and take the address automatically.But that does not make f(*T) > and f(T) the same thing. >
At least the spec is some misleading here. ok, at least for me. I always thought that a method M defined for type T is also a method of *T. > > > -- > > -j > -- 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.