Skip to content

Commit dda3d00

Browse files
authored
Merge pull request #204 from simeonschaub/sds/fix_consprop
adapt to JuliaLang/julia#42125
2 parents 5699c53 + 6359fda commit dda3d00

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ArrayInterface"
22
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
3-
version = "3.1.32"
3+
version = "3.1.33"
44

55
[deps]
66
IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173"
@@ -12,7 +12,7 @@ Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
1212
[compat]
1313
IfElse = "0.1"
1414
Requires = "0.5, 1.0"
15-
Static = "0.3"
15+
Static = "0.3.3"
1616
julia = "1.2"
1717

1818
[extras]

src/ArrayInterface.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ using Base: @propagate_inbounds, tail, OneTo, LogicalIndex, Slice, ReinterpretAr
1414

1515

1616
## utilites for internal use only ##
17-
@static if VERSION >= v"1.7.0-DEV.421"
18-
using Base: @aggressive_constprop
17+
@static if isdefined(Base, Symbol("@constprop"))
18+
using Base: @constprop
1919
else
20-
macro aggressive_constprop(ex)
20+
macro constprop(_, ex)
2121
ex
2222
end
2323
end

src/dimensions.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function from_parent_dims(::Type{R}) where {T,N,S,A,R<:ReinterpretArray{T,N,S,A}
7373
end
7474

7575
from_parent_dims(x, dim) = from_parent_dims(typeof(x), dim)
76-
@aggressive_constprop function from_parent_dims(::Type{T}, dim::Int)::Int where {T}
76+
@constprop :aggressive function from_parent_dims(::Type{T}, dim::Int)::Int where {T}
7777
if dim > ndims(T)
7878
return static(ndims(parent_type(T)) + dim - ndims(T))
7979
elseif dim > 0
@@ -127,7 +127,7 @@ function to_parent_dims(::Type{R}) where {T,N,S,A,R<:ReinterpretArray{T,N,S,A}}
127127
end
128128

129129
to_parent_dims(x, dim) = to_parent_dims(typeof(x), dim)
130-
@aggressive_constprop function to_parent_dims(::Type{T}, dim::Int)::Int where {T}
130+
@constprop :aggressive function to_parent_dims(::Type{T}, dim::Int)::Int where {T}
131131
if dim > ndims(T)
132132
return static(ndims(parent_type(T)) + dim - ndims(T))
133133
elseif dim > 0
@@ -200,7 +200,7 @@ function to_dims(::Type{T}, dim::StaticSymbol) where {T}
200200
end
201201
return i
202202
end
203-
@aggressive_constprop function to_dims(::Type{T}, dim::Symbol) where {T}
203+
@constprop :aggressive function to_dims(::Type{T}, dim::Symbol) where {T}
204204
i = find_first_eq(dim, map(Symbol, dimnames(T)))
205205
if i === nothing
206206
throw_dim_error(T, dim)
@@ -227,7 +227,7 @@ order_named_inds(x::Tuple, ::NamedTuple{(),Tuple{}}) = ()
227227
function order_named_inds(x::Tuple, nd::NamedTuple{L}) where {L}
228228
return order_named_inds(x, static(Val(L)), Tuple(nd))
229229
end
230-
@aggressive_constprop function order_named_inds(
230+
@constprop :aggressive function order_named_inds(
231231
x::Tuple{Vararg{Any,N}},
232232
nd::Tuple,
233233
inds::Tuple

0 commit comments

Comments
 (0)