4 ms·
Kotlin pattern matching and destructuring/unapply support are pretty weak, no?
by sk5t 6y ago
Kotlin pattern matching and destructuring/unapply support are pretty weak, no?
- gher-shyu3i 6y agoYes, Java's pattern matching is much more fully fledged than Kotlin's. You can destructure nested types. Also, at some point in the (near) future, you should be able to do things like: Object o = new int[]{1, 2}; if (o instanceof int[] {var a, var b}) { // a == 1, b == 2 }