Factorize type name equality checks in CheckIO.