Skip to content

Commit e60bcee

Browse files
committed
Add inference soundness test for splatting long range
Explicitly test that inference produces a sound (and reasonably precise) result when splatting an iterator (in this case a long range) that allows constant-propagation up to the `MAX_TUPLE_SPLAT` limit.
1 parent 42db34e commit e60bcee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/compiler/inference.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2872,7 +2872,9 @@ partial_return_2(x) = Val{partial_return_1(x)[2]}
28722872

28732873
@test Base.return_types(partial_return_2, (Int,)) == Any[Type{Val{1}}]
28742874

2875-
# Precision of abstract_iteration
2875+
# Soundness and precision of abstract_iteration
2876+
f41839() = (1:100...,)
2877+
@test NTuple{100,Int} <: only(Base.return_types(f41839, ())) <: Tuple{Vararg{Int}}
28762878
f_splat(x) = (x...,)
28772879
@test Base.return_types(f_splat, (Pair{Int,Int},)) == Any[Tuple{Int, Int}]
28782880
@test Base.return_types(f_splat, (UnitRange{Int},)) == Any[Tuple{Vararg{Int}}]

0 commit comments

Comments
 (0)