We can special-treat some common patterns however. If the scrutinee is a List and the
pattern is a Nil then we know that we can get by with an instanceof or eq comparison.
Same for None in Option. Same again for any case object that gets the synthesized
equals instead of a user-defined one.
Because these cases should be quite common it's probably worth to do it.
when a constant pattern is statically known to have a synthetic equals method that simply calls `eq`, do not perform a null check and call `eq` directly.
similarly, an instanceof check implies non-nullness, so don't re-check null
Yes, or instanceof. - Martin