Skip to content

Commit

Permalink
Simplify the definition of StridedArray; remove third type param (#26012
Browse files Browse the repository at this point in the history
)

Previously, the `StridedArray` type-alias had three type parameters -- the usual `T` and `N`, but also an `A` parameter that kinda-sorta restricted the "parent" array of some of the view types.  It did not really work, though:

```julia
julia> reshape(codeunits("foo"),1,3) isa StridedArray{<:Any,<:Any,<:Array}
true
```

This commit removes that third type parameter from the binding. This should otherwise be functionally equivalent.
  • Loading branch information
mbauman authored and JeffBezanson committed Feb 14, 2018
1 parent 2cc3e8c commit 00b7ff8
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,11 @@ include("strings/string.jl")
# Definition of StridedArray
StridedReshapedArray{T,N,A<:Union{DenseArray,FastContiguousSubArray}} = ReshapedArray{T,N,A}
StridedReinterpretArray{T,N,A<:Union{DenseArray,FastContiguousSubArray}} = ReinterpretArray{T,N,S,A} where S
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}, StridedReinterpretArray{T,N,A}}
StridedVector{T,A<:Union{DenseArray,StridedReshapedArray},
I<:Tuple{Vararg{Union{RangeIndex, AbstractCartesianIndex}}}} =
Union{DenseArray{T,1}, SubArray{T,1,A,I}, StridedReshapedArray{T,1}, StridedReinterpretArray{T,1,A}}
StridedMatrix{T,A<:Union{DenseArray,StridedReshapedArray},
I<:Tuple{Vararg{Union{RangeIndex, AbstractCartesianIndex}}}} =
Union{DenseArray{T,2}, SubArray{T,2,A,I}, StridedReshapedArray{T,2}, StridedReinterpretArray{T,2,A}}
StridedSubArray{T,N,A<:Union{DenseArray,StridedReshapedArray},
I<:Tuple{Vararg{Union{RangeIndex, AbstractCartesianIndex}}}} = SubArray{T,N,A,I}
StridedArray{T,N} = Union{DenseArray{T,N}, StridedSubArray{T,N}, StridedReshapedArray{T,N}, StridedReinterpretArray{T,N}}
StridedVector{T} = Union{DenseArray{T,1}, StridedSubArray{T,1}, StridedReshapedArray{T,1}, StridedReinterpretArray{T,1}}
StridedMatrix{T} = Union{DenseArray{T,2}, StridedSubArray{T,2}, StridedReshapedArray{T,2}, StridedReinterpretArray{T,2}}
StridedVecOrMat{T} = Union{StridedVector{T}, StridedMatrix{T}}

# For OS specific stuff
Expand Down

0 comments on commit 00b7ff8

Please sign in to comment.