You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
improve implementations of the tuple_ functions, removing @pure (#22)
Bumped patch version to 1.4.2.
The new method definitions make `Base.@pure` annotations for these
methods unnecessary.
Inference tested with Julia v1.9.2, the latest release; both with and
without `--check-bounds=yes`.
The script for testing inference is appended. `:consistent` (`+c`),
`:effect_free` (`+e`) and `:terminates_globally` (`+t`) are
successfully inferred in each case:
```julia
using Test, StaticArraysCore
const test_types = (
Tuple{}, Tuple{1}, Tuple{2}, Tuple{1,1}, Tuple{2,3},
Tuple{1,2,3,4,5,6,7,8,9,1,2,3}, Tuple{9,2,7,4,5,9,7,8,9,4,2,3},
)
const test_functions = (
StaticArraysCore.tuple_length, StaticArraysCore.tuple_prod,
StaticArraysCore.tuple_minimum, StaticArraysCore.size_to_tuple,
StaticArraysCore.Size,
)
function test_func(f::F) where {F}
for T ∈ test_types
# Test return type inference
@inferred f(T)
end
for T ∈ test_types
# Test effect inference
print(" ")
display(Base.infer_effects(f, (Type{T},)))
end
nothing
end
function test_func()
for f ∈ test_functions
println(f, ":")
test_func(f)
println()
end
nothing
end
test_func()
```
0 commit comments