diff --git a/src/subtype.c b/src/subtype.c index 4aadeef3404408..260252fe3d2ddd 100644 --- a/src/subtype.c +++ b/src/subtype.c @@ -235,6 +235,10 @@ static int obviously_unequal(jl_value_t *a, jl_value_t *b) if (jl_is_datatype(b)) { jl_datatype_t *ad = (jl_datatype_t*)a; jl_datatype_t *bd = (jl_datatype_t*)b; + if (a == (jl_value_t*)jl_typeofbottom_type && bd->name == jl_type_typename) + return obviously_unequal(jl_bottom_type, jl_tparam(bd, 0)); + if (ad->name == jl_type_typename && b == (jl_value_t*)jl_typeofbottom_type) + return obviously_unequal(jl_tparam(ad, 0), jl_bottom_type); if (ad->name != bd->name) return 1; int istuple = (ad->name == jl_tuple_typename); diff --git a/test/subtype.jl b/test/subtype.jl index 61dbdaa4db7c22..265be9981d3202 100644 --- a/test/subtype.jl +++ b/test/subtype.jl @@ -1767,3 +1767,6 @@ end # issue #37180 @test !(typeintersect(Tuple{AbstractArray{T}, VecOrMat{T}} where T, Tuple{Array, Any}).body.parameters[1] isa Union) + +# issue #37255 +@test Type{Union{}} == Type{T} where {Union{}<:T<:Union{}}