Skip to content

Commit

Permalink
codegen: fix unswitchtupleunion for empty Tuple{}
Browse files Browse the repository at this point in the history
Fixes #42579

Backports relevant line from #39754 (2e21b38)
  • Loading branch information
vtjnash committed Oct 18, 2021
1 parent cc71755 commit 1e17975
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/compiler/typeutils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function unswitchtupleunion(u::Union)
ts = uniontypes(u)
n = -1
for t in ts
if t isa DataType && t.name === Tuple.name && !isvarargtype(t.parameters[end])
if t isa DataType && t.name === Tuple.name && length(t.parameters) != 0 && !isvarargtype(t.parameters[end])
if n == -1
n = length(t.parameters)
elseif n != length(t.parameters)
Expand Down

0 comments on commit 1e17975

Please sign in to comment.