Skip to content

Commit 5d98ff2

Browse files
timholyvtjnashKristofferCaviatesk
authored andcommitted
Use jl_types_egal in equiv_field_types (JuliaLang#52748)
Fixes JuliaLang#52686 Fixes timholy/Revise.jl#770 --------- Co-authored-by: Jameson Nash <vtjnash@gmail.com> Co-authored-by: Kristoffer Carlsson <kcarlsson89@gmail.com> Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com>
1 parent 47fd6fa commit 5d98ff2

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/builtins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,7 @@ static int equiv_field_types(jl_value_t *old, jl_value_t *ft)
16781678
jl_value_t *ta = jl_svecref(old, i);
16791679
jl_value_t *tb = jl_svecref(ft, i);
16801680
if (jl_has_free_typevars(ta)) {
1681-
if (!jl_has_free_typevars(tb) || !jl_egal(ta, tb))
1681+
if (!jl_has_free_typevars(tb) || !jl_types_egal(ta, tb))
16821682
return 0;
16831683
}
16841684
else if (jl_has_free_typevars(tb) || jl_typetagof(ta) != jl_typetagof(tb) ||

test/core.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,21 @@ let abcd = ABCDconst(1, 2, 3, 4)
107107
abcd.d = nothing)
108108
@test (1, 2, "not constant", 4) === (abcd.a, abcd.b, abcd.c, abcd.d)
109109
end
110+
# Issue #52686
111+
struct A52686{T} end
112+
struct B52686{T, S}
113+
a::A52686{<:T}
114+
end
115+
function func52686()
116+
@eval begin
117+
struct A52686{T} end
118+
struct B52686{T, S}
119+
a::A52686{<:T}
120+
end
121+
end
122+
return true
123+
end
124+
@test func52686()
110125

111126
# test `===` handling null pointer in struct #44712
112127
struct N44712

0 commit comments

Comments
 (0)