▲ | SkiFire13 4 days ago | ||||||||||||||||
> had it since version 1. Now, 15 versions later, C# has acquired all the modern features from all paradigms of programming, including [...] an incredibly full-featured pattern matching system. Java is laughably lagging behind. Did C# finally implement some kind of discriminated unions with exhaustive pattern matching? Last time I checked not even plain `enum`s supported exhaustive pattern matching. For comparison, even Java supports discriminated unions in the shape of sealed classes/interfaces with exhaustive pattern matching since Java 21 | |||||||||||||||||
▲ | stonemetal12 4 days ago | parent [-] | ||||||||||||||||
Sort of. They are a part of C#14 and .net10. Which officially releases in Nov, but has been out as preview for a while now. | |||||||||||||||||
|