Re: [go-nuts] Re: confusing differences in reflect Type knowledge for a receiver vs. an argument

2018-03-06 Thread Ian Lance Taylor
On Mon, Mar 5, 2018 at 9:53 PM, Randall O'Reilly wrote: > On Mar 5, 2018, at 10:32 PM, Ian Lance Taylor wrote: >> >> Go doesn't have anything like inheritance in C++. What you are >> calling the "true underlying type" simply doesn't exist in Go. Go has >> embedded fields, and methods of embedde

Re: [go-nuts] Re: confusing differences in reflect Type knowledge for a receiver vs. an argument

2018-03-05 Thread Randall O'Reilly
On Mar 5, 2018, at 10:32 PM, Ian Lance Taylor wrote: > > Go doesn't have anything like inheritance in C++. What you are > calling the "true underlying type" simply doesn't exist in Go. Go has > embedded fields, and methods of embedded fields are promoted to become > methods of the outer type in

Re: [go-nuts] Re: confusing differences in reflect Type knowledge for a receiver vs. an argument

2018-03-05 Thread Ian Lance Taylor
On Mon, Mar 5, 2018 at 8:08 PM, Randall O'Reilly wrote: > Thank you for that clarification of what is happening under the hood. > > Nevertheless, I do think there are many cases where it would be very valuable > to have access through reflect of the true underlying type of the receiver > struct.

Re: [go-nuts] Re: confusing differences in reflect Type knowledge for a receiver vs. an argument

2018-03-05 Thread Randall O'Reilly
Thank you for that clarification of what is happening under the hood. Nevertheless, I do think there are many cases where it would be very valuable to have access through reflect of the true underlying type of the receiver struct. This is evident in that stack overflow question, the *JSON code,