diff --git a/base/compiler/tfuncs.jl b/base/compiler/tfuncs.jl index b7d3b1e282e39..995c57bd4f0b0 100644 --- a/base/compiler/tfuncs.jl +++ b/base/compiler/tfuncs.jl @@ -1558,6 +1558,8 @@ function tuple_tfunc(argtypes::Vector{Any}) else params[i] = Type end + elseif x === DataType || x === UnionAll + params[i] = x elseif !isvarargtype(x) && hasintersect(x, Type) params[i] = Union{x, Type} else diff --git a/test/compiler/inference.jl b/test/compiler/inference.jl index d18ef0f64495e..266cb1628f8c6 100644 --- a/test/compiler/inference.jl +++ b/test/compiler/inference.jl @@ -1569,6 +1569,8 @@ let tuple_tfunc @test Core.Compiler.widenconst(tuple_tfunc(Type{Int})) === Tuple{DataType} # https://github.com/JuliaLang/julia/issues/44705 @test tuple_tfunc(Union{Type{Int32},Type{Int64}}) === Tuple{Type} + @test tuple_tfunc(DataType) === Tuple{DataType} + @test tuple_tfunc(UnionAll) === Tuple{UnionAll} end function f23024(::Type{T}, ::Int) where T