Elimination of is/asInstanceOf's based on static information.

Is there a reason you introduce this case twice?