diff --git a/stdlib/InteractiveUtils/src/macros.jl b/stdlib/InteractiveUtils/src/macros.jl index 6bed2a0be0b07..10b247beff11f 100644 --- a/stdlib/InteractiveUtils/src/macros.jl +++ b/stdlib/InteractiveUtils/src/macros.jl @@ -15,7 +15,7 @@ function recursive_dotcalls!(ex, args, i=1) if !(ex isa Expr) || ((ex.head !== :. || !(ex.args[2] isa Expr)) && (ex.head !== :call || string(ex.args[1])[1] != '.')) newarg = Symbol('x', i) - if ex.head === :... + if Meta.isexpr(ex, :...) push!(args, only(ex.args)) return Expr(:..., newarg), i+1 else diff --git a/stdlib/InteractiveUtils/test/runtests.jl b/stdlib/InteractiveUtils/test/runtests.jl index 7bbc2b321a440..7e2d6f3136b3e 100644 --- a/stdlib/InteractiveUtils/test/runtests.jl +++ b/stdlib/InteractiveUtils/test/runtests.jl @@ -332,6 +332,15 @@ B33163(x) = x @test (@code_typed max.(Ref(true).x))[2] == Bool @test !isempty(@code_typed optimize=false max.(Ref.([5, 6])...)) +# Issue #36261 +@test (@code_typed max.(1 .+ 3, 5 - 7))[2] == Int +f36261(x,y) = 3x + 4y +A36261 = Float64[1.0, 2.0, 3.0] +@test (@code_typed f36261.(A36261, pi))[1].inferred +@test (@code_typed f36261.(A36261, 1 .+ pi))[1].inferred +@test (@code_typed f36261.(A36261, 1 + pi))[1].inferred + + module ReflectionTest using Test, Random, InteractiveUtils