Skip to content

Commit fbc5d58

Browse files
authored
Merge pull request #20 from pabloferz/patch-1
Fix similar to take UnionAll into account
2 parents 334f5e1 + 1fe637c commit fbc5d58

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/OffsetArrays.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function Base.similar{T}(A::AbstractArray, ::Type{T}, inds::Tuple{UnitRange,Vara
6767
OffsetArray(B, map(indexoffset, inds))
6868
end
6969

70-
Base.similar(f::Union{Function,DataType}, shape::Tuple{UnitRange,Vararg{UnitRange}}) = OffsetArray(f(map(length, shape)), map(indexoffset, shape))
70+
Base.similar(f::Union{Function,Type}, shape::Tuple{UnitRange,Vararg{UnitRange}}) = OffsetArray(f(map(length, shape)), map(indexoffset, shape))
7171

7272
Base.reshape(A::AbstractArray, inds::Tuple{UnitRange,Vararg{UnitRange}}) = OffsetArray(reshape(A, map(length, inds)), map(indexoffset, inds))
7373

0 commit comments

Comments
 (0)