fix mishandling of inference of global var types