Earlier quoted context omitted.
I don't mind that the compiler doesn't provide a default string implementation by default. I'm happy to use string values in my enums (in most cases const string vs int doesn't matter much for performance) for convenience; what I do wish for is full-blown ADTs. I want to be able to express `'Hello' | 'World' | 42 | struct{Name string, Age int} | []int` and know that the compiler will enforce. You can sort of get ther…
Do you have any examples of how you would implement a makeshift sum type like your example?
X interface{} // int(3) | int(5) | []float64 | *Z
It sucks.