From fabe74d09536dac8e181e00881807c4cc8588a5a Mon Sep 17 00:00:00 2001 From: Rafael Schouten Date: Sat, 25 Jan 2020 13:08:15 +1100 Subject: [PATCH] bugfix formatdims --- src/primitives.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/primitives.jl b/src/primitives.jl index 4de4621f6..3f404f560 100644 --- a/src/primitives.jl +++ b/src/primitives.jl @@ -177,7 +177,7 @@ hasdim(A, lookup::Type) = hasdim(typeof(dims(A)), lookup) end end -setdim(A, newdim::AbDim) = rebuild(A; dims=setdim(dims(A), newdim)) +setdim(A, newdim::AbDim) = rebuild(A; dims=setdim(dims(A), newdim)) setdim(dims::AbDimTuple, newdim::AbDim) = map(d -> setdim(d, newdim), dims) setdim(dim::AbDim, newdim::AbDim) = basetypeof(dim) <: basetypeof(newdim) ? newdim : dim @@ -203,7 +203,7 @@ formatdims(A::AbstractArray{T,N}, dims::Tuple) where {T,N} = begin dimlen == N || throw(ArgumentError("dims ($dimlen) don't match array dimensions $(N)")) formatdims(axes(A), dims) end -formatdims(axes::Tuple, dims::AbDimTuple) where N = map(formatdims, axes, dims) +formatdims(axes::Tuple, dims::Tuple) where N = map(formatdims, axes, dims) formatdims(axis::AbstractRange, dim::AbDim{<:AbstractArray}) = begin checklen(dim, axis) rebuild(dim, val(dim), identify(grid(dim), val(dim)))