Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "StaticArraysCore"
uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
version = "1.4.4"
version = "1.4.5"

[compat]
julia = "1.6"
Expand Down
1 change: 1 addition & 0 deletions src/StaticArraysCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ tuple_prod(T::Tuple) = prod(T)
tuple_minimum(T::Tuple) = minimum(T)

tuple_svec(::Type{T}) where {T<:Tuple} = T.parameters
tuple_svec(::Type{Union{}}) = throw(ArgumentError("Union{} is not a tuple type"))

# Julia `Base` provides a function for this purpose since v1.1: `fieldtypes`.
# We don't use it yet, though, because it wrecks type inference with Julia
Expand Down
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ using StaticArraysCore, Test
@test StaticArraysCore.tuple_length((5, 3)) == 2
@test StaticArraysCore.tuple_prod((5, 3)) == 15
@test StaticArraysCore.tuple_minimum((5, 3)) == 3
@test Tuple(StaticArraysCore.tuple_svec(Tuple{})) === ()
@test Tuple(StaticArraysCore.tuple_svec(Tuple{5,3})) === (5, 3)
@test Tuple(StaticArraysCore.tuple_svec(Tuple{Int,Float64})) === (Int, Float64)
@test_throws ArgumentError StaticArraysCore.tuple_svec(Union{})
@test_throws ArgumentError StaticArraysCore.tuple_tuple(Union{})
@test_throws ArgumentError StaticArraysCore.size_to_tuple(Union{})

@test StaticArraysCore.StaticArrayStyle{1}(Val(2)) === StaticArraysCore.StaticArrayStyle{2}()
end
Expand Down
Loading