Type assignment for intersections and unions in call-by-value languages