type_val: fix a type bug parsing global assignments