3 ms·
Go does not have type inheritance, so there's no such thing as "the top type".
by dsymonds 12y ago
Go does not have type inheritance, so there's no such thing as "the top type".
- friendly_chap 12y agowyager is right, empty interfaces in Go are exactly that - a type (set) which every value is a member of, search for Go/interface{}: http://en.wikipedia.org/wiki/Top_type http://en.wikipedia.org/wiki/Top_type Edit: the downvoter cares to explain?
- overcyn 12y ago"However, several languages have types in the second regard above (e.g. void * in C++, id in Objective-C, interface{} in Go), static types whose variables can accept any object value, but which do not reflect real runtime types that an object can have in the type system, so are not top types in the first regard." Do you consider void* the same as Java's Object?
- coldtea 12y agoWell, the "all encompassing" type. Or the "variant" type.