Skip to content

Commit 2a19cc8

Browse files
committed
Fix fastpath in typekey_eq
1 parent 90b6e1d commit 2a19cc8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/jltypes.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,8 @@ static int typekey_eq(jl_datatype_t *tt, jl_value_t **key, size_t n)
563563
// require exact same Type{T}. see e.g. issue #22842
564564
if (jl_is_type_type(tj) || jl_is_type_type(kj))
565565
return 0;
566-
if (jl_is_concrete_type(tj) || jl_is_concrete_type(kj))
566+
if ((jl_is_concrete_type(tj) || jl_is_concrete_type(kj)) &&
567+
jl_type_equality_is_identity(tj, kj))
567568
return 0;
568569
if (!jl_types_equal(tj, kj))
569570
return 0;

test/subtype.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,11 +1362,13 @@ end
13621362
@test Vector{Tuple{Any}}() isa Vector{Tuple{>:Int}}
13631363
@test Vector{Tuple{>:Int}}() isa Vector{Tuple{Any}}
13641364
@test Vector{Tuple{Any}} == Vector{Tuple{>:Int}}
1365+
@test Vector{Vector{Tuple{Any}}} == Vector{Vector{Tuple{>:Int}}}
13651366
f25430(t::Vector{Tuple{Any}}) = true
13661367
g25430(t::Vector{Tuple{>:Int}}) = true
13671368
@test f25430(Vector{Tuple{>:Int}}())
13681369
@test g25430(Vector{Tuple{Any}}())
13691370
@testintersect(Vector{Tuple{>:Int}}, Vector{Tuple{Any}}, Vector{Tuple{Any}})
1371+
@testintersect(Vector{Vector{Tuple{>:Int}}}, Vector{Vector{Tuple{Any}}}, Vector{Vector{Tuple{Any}}})
13701372

13711373
# issue #24521
13721374
g24521(::T, ::T) where {T} = T

0 commit comments

Comments
 (0)