You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just capturing an idea; not sure if it is high-value. In something like
case MyRecord(int foo, _, var bar)
A warning could be issued if the name of any pattern variable (here, "foo" or "bar") has a shorter edit distance to some other component of the record than the one it is matched up with.
Positional APIs can be hard to remember. This applies to instanceof as well. Currently this only applies to record patterns, but in the future there may be deconstructors for non-record classes too.
The text was updated successfully, but these errors were encountered:
I think we may already have this via ArgumentSelectionDefectChecker and its friends.
We should certainly make sure that applies to records as well! I'm suspicious that there's a separate AutoValueConstructorOrderChecker, which makes me wonder if we do need to special-case records somehow.
Just capturing an idea; not sure if it is high-value. In something like
case MyRecord(int foo, _, var bar)
A warning could be issued if the name of any pattern variable (here, "foo" or "bar") has a shorter edit distance to some other component of the record than the one it is matched up with.
Positional APIs can be hard to remember. This applies to
instanceof
as well. Currently this only applies to record patterns, but in the future there may be deconstructors for non-record classes too.The text was updated successfully, but these errors were encountered: