Florian
08/29/2019, 1:29 PMwhen
statement?Marko Mitic
08/29/2019, 1:32 PM.equals
functionkarelpeeters
08/29/2019, 1:36 PMin
.Florian
08/29/2019, 1:42 PM.equals
, right?Alowaniak
08/29/2019, 1:44 PMdata
class (since you're talking about "any data type") it will have a "proper" equalsFlorian
08/29/2019, 1:46 PMwhen
will compile?Marko Mitic
08/29/2019, 1:47 PMFlorian
08/29/2019, 1:48 PMwhen
is so much more flexible than switch
? Surely the designers must have had a reason why they made switch so limited.Marko Mitic
08/29/2019, 1:56 PMwhen
Florian
08/29/2019, 2:00 PMkarelpeeters
08/29/2019, 2:17 PMwhen
is not that powerful either, other languages like Scala, C#, Rust and others have actual pattern matching.Florian
08/29/2019, 2:19 PMMarko Mitic
08/29/2019, 2:32 PMMike
08/29/2019, 5:19 PMswitch
. Much closer to Groovy switch/Kotlin when.
Details: https://www.oracle.com/technetwork/java/javase/12-relnote-issues-5211422.html#JDK-8192963
And in future versions, they intend to introduce forms of pattern matching.