4 ms·
How is that even possible? Surely there must be a type tag associated with each object if you can dispatch on it, just like in other languages.
by jules 14y ago
How is that even possible? Surely there must be a type tag associated with each object if you can dispatch on it, just like in other languages.
- psykotic 14y agoA variable of an interface type is a pair consisting of a type descriptor and a concrete value. It is only when a concrete value of a statically known type is passed to something expecting an interface type that such a type tagged value is constructed.
- enneff 14y agoFor interface values there is a type associated with each value. For normal values you don't need it, because Go is statically typed. The compiler knows where the method is.