3 ms·
What kinds of pattern matching that Java now has is Kotlin missing?
by simonkagedal 3y ago
What kinds of pattern matching that Java now has is Kotlin missing?
- richbell 3y agoAt 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/ https://www.infoq.com/articles/pattern-matching-for-switch/