Skip to content

Commit 37d3b57

Browse files
committed
Fix to_shape and versioning
1 parent a2559c0 commit 37d3b57

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

lib/ArrayInterfaceOffsetArrays/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
1010
[compat]
1111
ArrayInterface = "5, 6"
1212
OffsetArrays = "1.11"
13-
Static = "0.6"
13+
Static = "0.7"
1414
julia = "1.6"
1515

1616
[extras]

lib/ArrayInterfaceStaticArrays/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
1212
[compat]
1313
Adapt = "3"
1414
ArrayInterface = "6"
15-
Static = "0.6"
15+
Static = "0.7"
1616
StaticArrays = "1.2.5, 1.3, 1.4"
1717
julia = "1.6"
1818

src/axes.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ Base.axes(x::Slice{<:LazyAxis}) = (Base.axes1(x),)
243243
# assuming that lazy loaded params like dynamic length from `size(::Array, dim)` are going
244244
# be used again later with `Slice{LazyAxis}`, we quickly load indices
245245
Base.axes1(x::Slice{<:LazyAxis}) = indices(parent(x.indices))
246-
Base.to_shape(x::LazyAxis) = length(x)
246+
Base.to_shape(x::LazyAxis) = Base.length(x)
247247

248248
@propagate_inbounds function Base.getindex(x::LazyAxis, i::CanonicalInt)
249249
@boundscheck checkindex(Bool, x, i) || throw(BoundsError(x, i))

src/ranges.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ function Base.iterate(::SOneTo{n}, s::Int) where {n}
294294
end
295295
end
296296

297-
Base.to_shape(x::OptionallyStaticRange) = length(x)
298-
Base.to_shape(x::Slice{T}) where {T<:OptionallyStaticRange} = length(x)
297+
Base.to_shape(x::OptionallyStaticRange) = Base.length(x)
298+
Base.to_shape(x::Slice{T}) where {T<:OptionallyStaticRange} = Base.length(x)
299299
Base.axes(S::Slice{<:OptionallyStaticUnitRange{One}}) = (S.indices,)
300300
Base.axes(S::Slice{<:OptionallyStaticRange}) = (Base.IdentityUnitRange(S.indices),)
301301

src/size.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ end
123123
# trailing dimensions (which must be of size 1), to `static(1)`. We want to stick to
124124
# `Nothing` and `Int` types, so we do one last pass to ensure everything is dynamic
125125
@inline function known_size(::Type{<:Iterators.Zip{T}}) where {T}
126-
dynamic(reduce_tup(_promote_shape, eachop(_unzip_size, nstatic(Val(known_length(T))), T)))
126+
dynamic(reduce_tup(Static._promote_shape, eachop(_unzip_size, nstatic(Val(known_length(T))), T)))
127127
end
128128
_unzip_size(::Type{T}, n::StaticInt{N}) where {T,N} = known_size(field_type(T, n))
129129
_known_size(::Type{T}, dim::StaticInt) where {T} = known_length(field_type(T, dim))

0 commit comments

Comments
 (0)