Skip to content

Commit 50ceb7a

Browse files
aviateskKristofferC
authored andcommitted
inference: don't widen DataType/UninAll to Type within tuple_tfunc (#44896)
Follows up #44725. (cherry picked from commit 0deb326)
1 parent b92e23e commit 50ceb7a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

base/compiler/tfuncs.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,6 +1527,8 @@ function tuple_tfunc(argtypes::Vector{Any})
15271527
else
15281528
params[i] = Type
15291529
end
1530+
elseif iskindtype(x)
1531+
params[i] = x
15301532
elseif !isvarargtype(x) && hasintersect(x, Type)
15311533
params[i] = Union{x, Type}
15321534
else

test/compiler/inference.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,6 +1571,8 @@ let tuple_tfunc
15711571
@test Core.Compiler.widenconst(tuple_tfunc(Type{Int})) === Tuple{DataType}
15721572
# https://github.com/JuliaLang/julia/issues/44705
15731573
@test tuple_tfunc(Union{Type{Int32},Type{Int64}}) === Tuple{Type}
1574+
@test tuple_tfunc(DataType) === Tuple{DataType}
1575+
@test tuple_tfunc(UnionAll) === Tuple{UnionAll}
15741576
end
15751577

15761578
function f23024(::Type{T}, ::Int) where T

0 commit comments

Comments
 (0)