New candidate JEP: 440: Record Patterns

David Alayachew davidalayachew at gmail.com
Sat Mar 18 06:22:19 UTC 2023


Hello Amber Dev Team,

Near the bottom of Record patterns (right above Record patterns and
exhaustive switch), there is the following quote.

---

For compatibility, type patterns do not support the implicit inference of
type arguments; e.g., the type pattern List l is always treated as a raw
type pattern.

---

This makes a lot of sense, and I certainly understand why this is the case.
But that does mean that there is an inconsistency.

If I start off with a record, and then later realize that it should instead
be a class with deconstructors, this may be a difficult to find bug in my
code. At least, that's what it seems like without any testing.

Is this inconsistency something that may be smoothed out further down the
line? More specifically, should records be given this privilege if classes
can't receive it too? Perhaps I am missing something, and thus, I'm just
misinterpreting?

Thank you for your time and help!
David Alayachew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/amber-dev/attachments/20230318/004886a3/attachment-0001.htm>


More information about the amber-dev mailing list