https://kotlinlang.org logo
Title
c

CircuitRCAY

07/01/2018, 12:51 AM
Is there any ETA on pattern matching or destructuring in Kotlin any time soon?
s

Shawn

07/01/2018, 12:53 AM
mind expanding for those of us who aren’t familiar with the proposal?
g

gildor

07/01/2018, 3:28 PM
Destructuring is there, but only one level, no nested one. There is an issue about this, be free to add your use cases if you need nested destructuring. There are no specific plans about full-blown pattern matching, as I know. Someone from Kotlin Team mentioned that they even designed pattern matching before 1.0, but dropped this feature because of complexity and because when and smart cast covers most of simple pattern matching use cases. But as I remember they can reconsider this later, but never heard about particular plans. Again, if you have good use cases for pattern matching be free to open an issue