Type matching by more generic class.