Hacker News new | ask | show | jobs
by pharmakom 1719 days ago
I don’t think sealed classes offer exhaustive pattern matching. Instead you have an if-else ladder of instanceof checks. This is not the same as most union type implementations.
1 comments

They do with switch expressions. It is only type based for now, but deconstructs are coming with full blown pattern matching a la Haskell.