There should already be a rule that eliminates casts that don't do anything, so I think this check is unnecessary.