Unify types of closured vars across usages