types2: apply GCD to variable instances when checking assignments