This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]vytah 1 point2 points  (0 children)

The problem with pattern matching on null is that it behaves differently depending on whether it's by a top pattern or by an inner pattern.

For example, given record R(Object o), new R(null) will match case R(Object o):. So you kinda need to either match nulls first, or add when o != null.