@@ -322,26 +322,6 @@ static int obviously_disjoint(jl_value_t *a, jl_value_t *b, int specificity)
322322        for (i = 0 ; i  <  np ; i ++ ) {
323323            jl_value_t  * ai  =  jl_tparam (ad ,i );
324324            jl_value_t  * bi  =  jl_tparam (bd ,i );
325-             if  (!istuple  &&  specificity  &&  jl_has_free_typevars (ai )) {
326-                 // X{<:SomeDataType} and X{Union{Y,Z,...}} need to be disjoint to 
327-                 // avoid this transitivity problem: 
328-                 // A = Tuple{Type{LinearIndices{N,R}}, LinearIndices{N}} where {N,R} 
329-                 // B = Tuple{Type{T},T} where T<:AbstractArray 
330-                 // C = Tuple{Type{Union{Nothing, T}}, Union{Nothing, T}} where T 
331-                 // A is more specific than B. It would be easy to think B is more specific 
332-                 // than C, but we can't have that since A should not be more specific than C. 
333-                 jl_value_t  * aub  =  jl_is_typevar (ai ) ? ((jl_tvar_t * )ai )-> ub  : ai ;
334-                 jl_value_t  * bub  =  jl_is_typevar (bi ) ? ((jl_tvar_t * )bi )-> ub  : bi ;
335-                 aub  =  jl_unwrap_unionall (aub );
336-                 bub  =  jl_unwrap_unionall (bub );
337-                 if  ((jl_is_typevar (ai ) +  jl_is_typevar (bi ) <  2 ) && 
338-                     aub  !=  (jl_value_t * )jl_any_type  &&  bub  !=  (jl_value_t * )jl_any_type  && 
339-                     ((jl_is_uniontype (aub ) &&  jl_is_datatype (bub ) &&  !in_union (aub , bub ) && 
340-                       (jl_is_typevar (bi ) ||  !jl_is_typevar (ai ))) || 
341-                      (jl_is_uniontype (bub ) &&  jl_is_datatype (aub ) &&  !in_union (bub , aub ) && 
342-                       (jl_is_typevar (ai ) ||  !jl_is_typevar (bi )))))
343-                     return  1 ;
344-             }
345325            if  (jl_is_typevar (ai ) ||  jl_is_typevar (bi ))
346326                continue ;
347327            if  (jl_is_type (ai )) {
@@ -2883,8 +2863,9 @@ static int type_morespecific_(jl_value_t *a, jl_value_t *b, int invariant, jl_ty
28832863            if  (((jl_tvar_t * )b )-> ub  ==  jl_bottom_type )
28842864                return  0 ;
28852865            if  (jl_has_free_typevars (a )) {
2886-                 if  (type_morespecific_ (a , ((jl_tvar_t * )b )-> ub , 0 , env ) || 
2887-                     eq_msp (a , ((jl_tvar_t * )b )-> ub , env ))
2866+                 if  (type_morespecific_ (a , ((jl_tvar_t * )b )-> ub , 0 , env ))
2867+                     return  1 ;
2868+                 if  (eq_msp (a , ((jl_tvar_t * )b )-> ub , env ))
28882869                    return  num_occurs ((jl_tvar_t * )b , env ) <  2 ;
28892870                return  0 ;
28902871            }
0 commit comments