Skip to content

Commit 24b525d

Browse files
N5N3KristofferC
authored andcommitted
inference: fix istuple check in apply_type_tfunc (#52585)
close #51927 (cherry picked from commit 58fac69)
1 parent e38f117 commit 24b525d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

base/compiler/tfuncs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1731,7 +1731,7 @@ const _tvarnames = Symbol[:_A, :_B, :_C, :_D, :_E, :_F, :_G, :_H, :_I, :_J, :_K,
17311731
end
17321732
return allconst ? Const(ty) : Type{ty}
17331733
end
1734-
istuple = isa(headtype, Type) && (headtype == Tuple)
1734+
istuple = headtype === Tuple
17351735
if !istuple && !isa(headtype, UnionAll) && !isvarargtype(headtype)
17361736
return Union{}
17371737
end

test/compiler/inference.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5129,3 +5129,8 @@ let TV = TypeVar(:T)
51295129
some = Some{Any}((TV, t))
51305130
@test abstract_call_unionall_vararg(some) isa UnionAll
51315131
end
5132+
5133+
# Issue #51927
5134+
let 𝕃 = Core.Compiler.fallback_lattice
5135+
@test apply_type_tfunc(𝕃, Const(Tuple{Vararg{Any,N}} where N), Int) == Type{NTuple{_A, Any}} where _A
5136+
end

0 commit comments

Comments
 (0)