Checking the type of locals in global assignments