Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use jl_types_egal in equiv_field_types #52748

Merged
merged 3 commits into from
Jan 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
# Issue #52686
struct A52686{T} end
struct B52686{T, S}
a::A52686{<:T}
end
function func52686()
@eval begin
struct A52686{T} end
struct B52686{T, S}
a::A52686{<:T}
end
end
return true
end
@test func52686()

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