3 ms·
Approximating closed sum types is easy already, by creating an interface with a stub private method and implementing it for all variants. Then it's not possible
by cube2222 5y ago
Approximating closed sum types is easy already, by creating an interface with a stub private method and implementing it for all variants. Then it's not possible to implement it using a type outside of that package.
The main thing that's lacking is compile time checks whether variant matching is exhaustive.