Towards member patterns [Brian Goetz]
mail.openjdk.org
mail.openjdk.org
What place do getters have in this new world of pattern-matching? The doc points out how methods in general still have value (functions that are not really inverse-able), but getters specifically? It kind of seems like there isn't really any more value in them. How do other languages who have had PM for longer use their getters? Or does PM just not overtake getters there like it looks like it will here?
Maybe getters can be seen as just another unconditional pattern, where it always matches. But in that case, it seems like a PM gives you all the capabilities of getters with a little more safety and flexibility. So in that case, again, why have normal getters? I won't go back and undo all my old code, but I'm starting to think I won't need to write any new getters ever again. (Unless I'm touching legacy code)