Suggestion: warning for pattern match cases of non-immediate traits

Wouldn’t a better solution here be to respect sealed in this case. As for the more real world example, if you annotate your Items class as final, you get an compile error for the wrong cases.

4 Likes