File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -499,10 +499,11 @@ end
499499
500500getindex (r:: Range , :: Colon ) = copy (r)
501501
502- function getindex {T<:Integer} (r:: UnitRange , s:: AbstractUnitRange{T} )
502+ function getindex {T<:Integer} (r:: AbstractUnitRange , s:: AbstractUnitRange{T} )
503503 @_inline_meta
504504 @boundscheck checkbounds (r, s)
505- st = oftype (r. start, r. start + first (s)- 1 )
505+ f = first (r)
506+ st = oftype (f, f + first (s)- 1 )
506507 range (st, length (s))
507508end
508509
Original file line number Diff line number Diff line change @@ -755,6 +755,7 @@ r = Base.OneTo(3)
755755@test minimum (r) == 1
756756@test maximum (r) == 3
757757@test r[2 ] == 2
758+ @test r[2 : 3 ] === 2 : 3
758759@test_throws BoundsError r[4 ]
759760@test_throws BoundsError r[0 ]
760761@test r+ 1 === 2 : 4
You can’t perform that action at this time.
0 commit comments