Skip to content

Commit

Permalink
Use jl_types_egal in equiv_field_types
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Jan 4, 2024
1 parent 5a28cf5 commit 8a81c69
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -1786,7 +1786,7 @@ static int equiv_field_types(jl_value_t *old, jl_value_t *ft)
jl_value_t *ta = jl_svecref(old, i);
jl_value_t *tb = jl_svecref(ft, i);
if (jl_has_free_typevars(ta)) {
if (!jl_has_free_typevars(tb) || !jl_egal(ta, tb))
if (!jl_has_free_typevars(tb) || !jl_types_egal(ta, tb))
return 0;
}
else if (jl_has_free_typevars(tb) || jl_typetagof(ta) != jl_typetagof(tb) ||
Expand Down
15 changes: 15 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,21 @@ let abcd = ABCDconst(1, 2, 3, 4)
abcd.d = nothing)
@test (1, 2, "not constant", 4) === (abcd.a, abcd.b, abcd.c, abcd.d)
end
@test begin
# Issue #52686
mktemp() do f, io
write(io, """
struct A{T} end
struct B{T, S}
a::A{<:T}
end
""")
close(io)
include(f)
include(f)
end
true
end

# test `===` handling null pointer in struct #44712
struct N44712
Expand Down

0 comments on commit 8a81c69

Please sign in to comment.