Skip to content

Commit

Permalink
Merge pull request #204 from simeonschaub/sds/fix_consprop
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod authored Sep 10, 2021
2 parents 5699c53 + 6359fda commit dda3d00
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ArrayInterface"
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
version = "3.1.32"
version = "3.1.33"

[deps]
IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173"
Expand All @@ -12,7 +12,7 @@ Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
[compat]
IfElse = "0.1"
Requires = "0.5, 1.0"
Static = "0.3"
Static = "0.3.3"
julia = "1.2"

[extras]
Expand Down
6 changes: 3 additions & 3 deletions src/ArrayInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ using Base: @propagate_inbounds, tail, OneTo, LogicalIndex, Slice, ReinterpretAr


## utilites for internal use only ##
@static if VERSION >= v"1.7.0-DEV.421"
using Base: @aggressive_constprop
@static if isdefined(Base, Symbol("@constprop"))
using Base: @constprop
else
macro aggressive_constprop(ex)
macro constprop(_, ex)
ex
end
end
Expand Down
8 changes: 4 additions & 4 deletions src/dimensions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function from_parent_dims(::Type{R}) where {T,N,S,A,R<:ReinterpretArray{T,N,S,A}
end

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

to_parent_dims(x, dim) = to_parent_dims(typeof(x), dim)
@aggressive_constprop function to_parent_dims(::Type{T}, dim::Int)::Int where {T}
@constprop :aggressive function to_parent_dims(::Type{T}, dim::Int)::Int where {T}
if dim > ndims(T)
return static(ndims(parent_type(T)) + dim - ndims(T))
elseif dim > 0
Expand Down Expand Up @@ -200,7 +200,7 @@ function to_dims(::Type{T}, dim::StaticSymbol) where {T}
end
return i
end
@aggressive_constprop function to_dims(::Type{T}, dim::Symbol) where {T}
@constprop :aggressive function to_dims(::Type{T}, dim::Symbol) where {T}
i = find_first_eq(dim, map(Symbol, dimnames(T)))
if i === nothing
throw_dim_error(T, dim)
Expand All @@ -227,7 +227,7 @@ order_named_inds(x::Tuple, ::NamedTuple{(),Tuple{}}) = ()
function order_named_inds(x::Tuple, nd::NamedTuple{L}) where {L}
return order_named_inds(x, static(Val(L)), Tuple(nd))
end
@aggressive_constprop function order_named_inds(
@constprop :aggressive function order_named_inds(
x::Tuple{Vararg{Any,N}},
nd::Tuple,
inds::Tuple
Expand Down

2 comments on commit dda3d00

@chriselrod
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/44684

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v3.1.33 -m "<description of version>" dda3d00578a8e0e865b7a90d331ecf49fa239868
git push origin v3.1.33

Also, note the warning: Version 3.1.33 skips over 3.1.32
This can be safely ignored. However, if you want to fix this you can do so. Call register() again after making the fix. This will update the Pull request.

Please sign in to comment.