Not sure I would call it "trivial." You just trade your segfault (or NullPointerException) for a pattern match error.
Although that little bit of static typing would probably have dealt with the vast majority of expensive null-pointer bugs.
Although that little bit of static typing would probably have dealt with the vast majority of expensive null-pointer bugs.