semantic: handle Union in ensureResolved