Skip to content

Commit 69c5ac9

Browse files
authored
help Julia with type inference by providing ntuple with Val (#1174)
As per JuliaArrays/StaticArraysCore.jl#21 Bumped patch version to 1.6.1.
1 parent b05454f commit 69c5ac9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "StaticArrays"
22
uuid = "90137ffa-7385-5640-81b9-e52037218182"
3-
version = "1.6.0"
3+
version = "1.6.1"
44

55
[deps]
66
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/SArray.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ _cat_size(x::AbstractArray, i) = size(x, i)
7979
_cat_sizes(x, dims) = ntuple(i -> _cat_size(x, i), dims)
8080

8181
function cat_any(::Val{maxdim}, ::Val{catdim}, args::Vector{Any}) where {maxdim,catdim}
82-
szs = Dims{maxdim}[_cat_sizes(a, maxdim) for a in args]
82+
szs = Dims{maxdim}[_cat_sizes(a, Val(maxdim)) for a in args]
8383
out = Array{Any}(undef, check_cat_size(szs, catdim))
84-
dims_before = ntuple(_ -> (:), catdim-1)
85-
dims_after = ntuple(_ -> (:), maxdim-catdim)
84+
dims_before = ntuple(_ -> (:), Val(catdim-1))
85+
dims_after = ntuple(_ -> (:), Val(maxdim-catdim))
8686
cat_any!(out, dims_before, dims_after, args)
8787
end
8888

@@ -104,7 +104,7 @@ end
104104

105105
@noinline cat_mismatch(j,sz,nsz) = throw(DimensionMismatch("mismatch in dimension $j (expected $sz got $nsz)"))
106106
function check_cat_size(szs::Vector{Dims{maxdim}}, catdim) where {maxdim}
107-
isempty(szs) && return ntuple(_ -> 0, maxdim)
107+
isempty(szs) && return ntuple(_ -> 0, Val(maxdim))
108108
sz = szs[1]
109109
catsz = sz[catdim]
110110
for i in 2:length(szs)

0 commit comments

Comments
 (0)