@@ -3,7 +3,9 @@ __precompile__()
3
3
module EllipsisNotation
4
4
5
5
import Base: to_indices, tail
6
- const .. = Val {:..} ()
6
+
7
+ struct Ellipsis end
8
+ const .. = Ellipsis ()
7
9
8
10
@inline fillcolons (inds, I) = fillcolons ((), inds, I)
9
11
@@ -12,15 +14,15 @@ const .. = Val{:..}()
12
14
@inline fillcolons (colons, t:: NTuple{N, <:Any} , :: NTuple{N, <:Any} ) where {N} = colons
13
15
@inline fillcolons (colons, t:: Tuple , s:: Tuple ) = fillcolons ((colons... , :), tail (t), s)
14
16
15
- @inline function to_indices (A, inds, I:: Tuple{Val{:..} , Vararg{Any, N}} ) where N
17
+ @inline function to_indices (A, inds, I:: Tuple{Ellipsis , Vararg{Any, N}} ) where N
16
18
# Align the remaining indices to the tail of the `inds`
17
19
colons = fillcolons (inds, tail (I))
18
20
to_indices (A, inds, (colons... , tail (I)... ))
19
21
end
20
22
21
23
# avoid copying if indexing with .. alone, see
22
24
# https://github.com/JuliaDiffEq/OrdinaryDiffEq.jl/issues/214
23
- @inline Base. getindex (A:: AbstractArray , :: Val{:..} ) = A
25
+ @inline Base. getindex (A:: AbstractArray , :: Ellipsis ) = A
24
26
25
27
export ..
26
28
0 commit comments