Checking and Casting to Subclass Types Patterns also enable you to match against the dynamic type of a class instance. Consider the following class hierarchy: