Skip to content

Commit 3522df1

Browse files
JeffBezansonararslan
authored andcommitted
revert part of cf2ed66 to fix JuliaDB test failure
Ref #24678 (cherry picked from commit 2f19f3f)
1 parent efba001 commit 3522df1

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

base/reflection.jl

+1-4
Original file line numberDiff line numberDiff line change
@@ -515,10 +515,7 @@ function _methods_by_ftype(t::ANY, lim::Int, world::UInt, min::Array{UInt,1}, ma
515515
end
516516
end
517517
if 1 < nu <= 64
518-
ms = _methods_by_ftype(Any[tp...], t, length(tp), lim, [], world, min, max)
519-
if all(m->isleaftype(m[1]), ms)
520-
return ms
521-
end
518+
return _methods_by_ftype(Any[tp...], t, length(tp), lim, [], world, min, max)
522519
end
523520
# XXX: the following can return incorrect answers that the above branch would have corrected
524521
return ccall(:jl_matching_methods, Any, (Any, Cint, Cint, UInt, Ptr{UInt}, Ptr{UInt}), t, lim, 0, world, min, max)

test/inference.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -963,14 +963,14 @@ end
963963
# approximate static parameters due to unions
964964
let T1 = Array{Float64}, T2 = Array{_1,2} where _1
965965
inference_test_copy(a::T) where {T<:Array} = ccall(:jl_array_copy, Ref{T}, (Any,), a)
966-
rt = Base.return_types(inference_test_copy, (Union{T1,T2},))[1]
966+
rt = Union{Base.return_types(inference_test_copy, (Union{T1,T2},))...}
967967
@test rt >: T1 && rt >: T2
968968

969969
el(x::T) where {T} = eltype(T)
970-
rt = Base.return_types(el, (Union{T1,Array{Float32,2}},))[1]
970+
rt = Union{Base.return_types(el, (Union{T1,Array{Float32,2}},))...}
971971
@test rt >: Union{Type{Float64}, Type{Float32}}
972972

973973
g(x::Ref{T}) where {T} = T
974-
rt = Base.return_types(g, (Union{Ref{Array{Float64}}, Ref{Array{Float32}}},))[1]
974+
rt = Union{Base.return_types(g, (Union{Ref{Array{Float64}}, Ref{Array{Float32}}},))...}
975975
@test rt >: Union{Type{Array{Float64}}, Type{Array{Float32}}}
976976
end

0 commit comments

Comments
 (0)