Skip to content

Commit 75ec75c

Browse files
committed
Fix Tuple inference regression from #18467
1 parent a648f4a commit 75ec75c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

base/inference.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ isType(t::ANY) = isa(t,DataType) && is((t::DataType).name,Type.name)
245245
# true if Type is inlineable as constant
246246
isconstType(t::ANY,b::Bool) =
247247
isType(t) && !has_typevars(t.parameters[1],b) &&
248-
!issubtype(Tuple{Vararg}, t.parameters[1]) # work around inference bug #18450
248+
!issubtype(Type{Tuple{Vararg}}, t) # work around inference bug #18450
249249

250250
const IInf = typemax(Int) # integer infinity
251251
const n_ifunc = reinterpret(Int32,arraylen)+1

test/inference.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,3 +368,6 @@ end
368368
# issue #18450
369369
f18450() = ifelse(true, Tuple{Vararg{Int}}, Tuple{Vararg})
370370
@test f18450() == Tuple{Vararg{Int}}
371+
372+
# issue #18569
373+
@test Core.Inference.isconstType(Type{Tuple},true)

0 commit comments

Comments
 (0)