From 59d564eaea336c5f5808b813037d9f18ce3ceb46 Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Fri, 10 Sep 2021 14:53:58 -0400 Subject: [PATCH 1/5] adapt to JuliaLang/julia#42125 --- src/ArrayInterface.jl | 4 ++-- src/dimensions.jl | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ArrayInterface.jl b/src/ArrayInterface.jl index b0254464d..e1282d090 100644 --- a/src/ArrayInterface.jl +++ b/src/ArrayInterface.jl @@ -15,9 +15,9 @@ 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 + using Base: @constprop else - macro aggressive_constprop(ex) + macro constprop(_, ex) ex end end diff --git a/src/dimensions.jl b/src/dimensions.jl index 29b832ce4..702b2b551 100644 --- a/src/dimensions.jl +++ b/src/dimensions.jl @@ -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 @@ -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 @@ -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) @@ -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 From 9d854bb7a27bf74c392b99d0201efcde5d9f4777 Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Fri, 10 Sep 2021 14:56:25 -0400 Subject: [PATCH 2/5] bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index cf2fbc85f..fd41695a5 100644 --- a/Project.toml +++ b/Project.toml @@ -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" From 22f5335d7484d3e60bcdfef5ed10b0301c1ed488 Mon Sep 17 00:00:00 2001 From: Chris Elrod Date: Fri, 10 Sep 2021 15:22:36 -0400 Subject: [PATCH 3/5] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index fd41695a5..d51e7370b 100644 --- a/Project.toml +++ b/Project.toml @@ -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.2" julia = "1.2" [extras] From 8294c7bb24ca4c1ebef2814c37eedbac8f0cc9f7 Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Fri, 10 Sep 2021 16:48:43 -0400 Subject: [PATCH 4/5] don't hardcode Julia version --- src/ArrayInterface.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ArrayInterface.jl b/src/ArrayInterface.jl index e1282d090..5d4cdb505 100644 --- a/src/ArrayInterface.jl +++ b/src/ArrayInterface.jl @@ -14,7 +14,7 @@ using Base: @propagate_inbounds, tail, OneTo, LogicalIndex, Slice, ReinterpretAr ## utilites for internal use only ## -@static if VERSION >= v"1.7.0-DEV.421" +@static if isdefined(Base, Symbol("@constprop")) using Base: @constprop else macro constprop(_, ex) From 6359fda8174422dad8abb9f46183eeeeb910300f Mon Sep 17 00:00:00 2001 From: Simeon Schaub Date: Fri, 10 Sep 2021 18:25:21 -0400 Subject: [PATCH 5/5] Update Project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index d51e7370b..525f63cd6 100644 --- a/Project.toml +++ b/Project.toml @@ -12,7 +12,7 @@ Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" [compat] IfElse = "0.1" Requires = "0.5, 1.0" -Static = "0.3.2" +Static = "0.3.3" julia = "1.2" [extras]