Skip to content

Commit

Permalink
Re-add a fast-path to obviously_unequal to re-fix #22624
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Apr 12, 2018
1 parent cddd135 commit 8f47a60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/subtype.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ static int obviously_unequal(jl_value_t *a, jl_value_t *b)
if ((jl_is_concrete_type(a) || jl_is_concrete_type(b)) &&
jl_type_equality_is_identity(a, b))
return 1;
if ((jl_is_concrete_type(a) && jl_is_typevar(b)) ||
(jl_is_concrete_type(b) && jl_is_typevar(a)))
return 1;
if (jl_is_unionall(a)) a = jl_unwrap_unionall(a);
if (jl_is_unionall(b)) b = jl_unwrap_unionall(b);
if (jl_is_datatype(a)) {
Expand Down
2 changes: 0 additions & 2 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ struct D21923{T,N}; v::D21923{T}; end
@test fieldtype(D21923, 1) == D21923

# issue #22624, more circular definitions
#= broken again :-(
struct T22624{A,B,C}; v::Vector{T22624{Int64,A}}; end
let elT = T22624.body.body.body.types[1].parameters[1]
@test elT == T22624{Int64, T22624.var, C} where C
Expand All @@ -209,7 +208,6 @@ let elT = T22624.body.body.body.types[1].parameters[1]
@test elT2.body.types[1].parameters[1] === elT2
@test Base.isconcretetype(elT2.body.types[1])
end
=#

# issue #3890
mutable struct A3890{T1}
Expand Down

0 comments on commit 8f47a60

Please sign in to comment.