Hacker News new | ask | show | jobs
by simonkagedal 1013 days ago
What kinds of pattern matching that Java now has is Kotlin missing?
1 comments

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/