Skip to content

diff on some ranges now error #36116

@KristofferC

Description

@KristofferC
julia> diff(0:2)
ERROR: ArgumentError: step cannot be zero
Stacktrace:
 [1] steprange_last(::Int64, ::Int64, ::Int64) at ./range.jl:215
 [2] StepRange at ./range.jl:205 [inlined]
 [3] _rangestyle at ./range.jl:118 [inlined]
 [4] _range at ./range.jl:116 [inlined]
 [5] #range#43 at ./range.jl:91 [inlined]
 [6] -(::UnitRange{Int64}, ::UnitRange{Int64}) at ./range.jl:1044
 [7] broadcasted at ./broadcast.jl:1081 [inlined]
 [8] broadcasted at ./broadcast.jl:1263 [inlined]
 [9] diff(::UnitRange{Int64}; dims::Int64) at ./multidimensional.jl:849
 [10] diff(::UnitRange{Int64}) at ./multidimensional.jl:809
 [11] top-level scope at REPL[3]:1

julia> diff(collect(0:2))
2-element Array{Int64,1}:
 1
 1

In 1.4, both of these gave a consistent answer.

From PkgEval for 1.5 (https://github.com/JuliaCI/NanosoldierReports/blob/90885ffd4005a91d0dc4150b8c1453f2f5948eb0/pkgeval/by_hash/194ddda_vs_b5f13c3/logs/ContinuumArrays/1.5.0-DEV-f11a73bd9c.log).

Metadata

Metadata

Assignees

No one assigned

    Labels

    regressionRegression in behavior compared to a previous version

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions