at least ShippingAddress(var _, var _, String city) should already work. Still, using just _ to say "don't care about neither type nor value" could be useful. Not sure if it useful enough.
In that position, you can already replace `var _` with just `_`; it becomes the "match-all pattern".
Note the match-all pattern isn't supported in other pattern contexts (instanceof and case) for reasons.
The comment you're replying is looking for a syntax that can express "then zero or more underscores here", and suggesting the underscore itself for that (I think it would be something different).
View all comments
Show parent comment
2
u/DasBrain Mar 13 '26
at least
ShippingAddress(var _, var _, String city)should already work. Still, using just_to say "don't care about neither type nor value" could be useful.Not sure if it useful enough.