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
Fix#9740: harden type checking for pattern match on objects
We enforce that when pattern match on an object, the object should be
a subtype of the scrutinee type.
Reasons for doing so:
- such code patterns usually implies hidden errors in the code
- it's always safe/sound to reject the code
We could check whether `equals` is overridden in the object, but
- it complicates the protocol
- overriding `equals` of object is also a bad practice
- there is no sign that the slightly improved completeness is useful
0 commit comments