Hacker News new | ask | show | jobs
by richbell 1019 days ago
It's unfortunate that Kotlin lacks pattern matching, especially now that Java has it. I can only hope that the release of the new compiler will spur further language features.
1 comments

What kinds of pattern matching that Java now has is Kotlin missing?
At the moment Kotlin only has smart casts and exhaustive type checking (e.g., making sure you didn't forget a switch case). It doesn't let you destructure records, add guards to cases, etc.

https://www.infoq.com/articles/pattern-matching-for-switch/