3 ms·
Scala and TypeScript have (partial) answers to this. In your example, Scala 2 would let Int32 and Int64 inherit a trait that Str doesn't. TypeScript would let
by mpartel 6y ago
Scala and TypeScript have (partial) answers to this.
In your example, Scala 2 would let Int32 and Int64 inherit a trait that Str doesn't. TypeScript would let you write a union type Int32 | Int64 that doesn't include Str (or add ExtraValue), and I think Scala 3 will have something very similar.