Skip to content

Commit b5cb181

Browse files
committed
Re-add a fast-path to obviously_unequal to re-fix #22624
1 parent 4da2609 commit b5cb181

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/subtype.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ static int obviously_unequal(jl_value_t *a, jl_value_t *b)
220220
if ((jl_is_concrete_type(a) || jl_is_concrete_type(b)) &&
221221
jl_type_equality_is_identity(a, b))
222222
return 1;
223+
if ((jl_is_concrete_type(a) && jl_is_typevar(b)) ||
224+
(jl_is_concrete_type(b) && jl_is_typevar(a)))
225+
return 1;
223226
if (jl_is_unionall(a)) a = jl_unwrap_unionall(a);
224227
if (jl_is_unionall(b)) b = jl_unwrap_unionall(b);
225228
if (jl_is_datatype(a)) {

test/core.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ struct D21923{T,N}; v::D21923{T}; end
218218
@test fieldtype(D21923, 1) == D21923
219219

220220
# issue #22624, more circular definitions
221-
#= broken again :-(
222221
struct T22624{A,B,C}; v::Vector{T22624{Int64,A}}; end
223222
let elT = T22624.body.body.body.types[1].parameters[1]
224223
@test elT == T22624{Int64, T22624.var, C} where C
@@ -227,7 +226,6 @@ let elT = T22624.body.body.body.types[1].parameters[1]
227226
@test elT2.body.types[1].parameters[1] === elT2
228227
@test Base.isconcretetype(elT2.body.types[1])
229228
end
230-
=#
231229

232230
# issue #3890
233231
mutable struct A3890{T1}

0 commit comments

Comments
 (0)