fix a typing bug in union-like operators