Skip to content

Commit

Permalink
Extend definition of StridedReshapedArray (#22429)
Browse files Browse the repository at this point in the history
* Extend definition of StridedReshapedArray

* Add test
  • Loading branch information
mtfishman authored and andreasnoack committed Jun 29, 2017
1 parent e91c0ff commit 92ff1bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ using .Iterators: zip, enumerate
using .Iterators: Flatten, product # for generators

# Definition of StridedArray
StridedReshapedArray{T,N,A<:DenseArray} = ReshapedArray{T,N,A}
StridedReshapedArray{T,N,A<:Union{DenseArray,FastContiguousSubArray}} = ReshapedArray{T,N,A}
StridedArray{T,N,A<:Union{DenseArray,StridedReshapedArray},
I<:Tuple{Vararg{Union{RangeIndex, AbstractCartesianIndex}}}} =
Union{DenseArray{T,N}, SubArray{T,N,A,I}, StridedReshapedArray{T,N}}
Expand Down
1 change: 1 addition & 0 deletions test/arrayops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ end
@test_throws MethodError convert(Array{Int,2}, r)
@test convert(Array{Int}, r) == [2,3,4]
@test Base.unsafe_convert(Ptr{Int}, r) == Base.unsafe_convert(Ptr{Int}, s)
@test isa(r, StridedArray) # issue #22411
end
@testset "linearslow" begin
s = view(a, :, [2,3,5])
Expand Down

0 comments on commit 92ff1bc

Please sign in to comment.