Type-checker optimization