From 1fe637cf6a84f78226b882ba2aaaa6e7b9c7326c Mon Sep 17 00:00:00 2001 From: Pablo Zubieta Date: Sat, 11 Feb 2017 14:55:58 -0600 Subject: [PATCH] Fix similar to take UnionAll into account x-ref https://github.com/JuliaLang/julia/issues/20569 --- src/OffsetArrays.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OffsetArrays.jl b/src/OffsetArrays.jl index 467ac54f..3a54d545 100644 --- a/src/OffsetArrays.jl +++ b/src/OffsetArrays.jl @@ -67,7 +67,7 @@ function Base.similar{T}(A::AbstractArray, ::Type{T}, inds::Tuple{UnitRange,Vara OffsetArray(B, map(indexoffset, inds)) end -Base.similar(f::Union{Function,DataType}, shape::Tuple{UnitRange,Vararg{UnitRange}}) = OffsetArray(f(map(length, shape)), map(indexoffset, shape)) +Base.similar(f::Union{Function,Type}, shape::Tuple{UnitRange,Vararg{UnitRange}}) = OffsetArray(f(map(length, shape)), map(indexoffset, shape)) Base.reshape(A::AbstractArray, inds::Tuple{UnitRange,Vararg{UnitRange}}) = OffsetArray(reshape(A, map(length, inds)), map(indexoffset, inds))