Skip to content

Commit

Permalink
inference: fix istuple check in apply_type_tfunc (#52585)
Browse files Browse the repository at this point in the history
close #51927
  • Loading branch information
N5N3 committed Dec 20, 2023
1 parent 69d5537 commit 58fac69
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/compiler/tfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ const _tvarnames = Symbol[:_A, :_B, :_C, :_D, :_E, :_F, :_G, :_H, :_I, :_J, :_K,
end
return allconst ? Const(ty) : Type{ty}
end
istuple = isa(headtype, Type) && (headtype == Tuple)
istuple = headtype === Tuple
if !istuple && !isa(headtype, UnionAll) && !isvarargtype(headtype)
return Union{}
end
Expand Down
5 changes: 5 additions & 0 deletions test/compiler/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5609,3 +5609,8 @@ let x = 1, _Any = Any
foo27031() = bar27031((x, 1.0), Val{_Any})
@test foo27031() == "OK"
end

# Issue #51927
let 𝕃 = Core.Compiler.fallback_lattice
@test apply_type_tfunc(𝕃, Const(Tuple{Vararg{Any,N}} where N), Int) == Type{NTuple{_A, Any}} where _A
end

0 comments on commit 58fac69

Please sign in to comment.