diff --git a/src/Compat.jl b/src/Compat.jl index 35e5fb1f2..12b0ff1d6 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -1860,8 +1860,18 @@ if VERSION < v"0.7.0-beta2.143" end end +# This definition should be modified to throw an ArgumentError if neither +# `step` nor `length` are given and be limited to VERSION < v"1.1.0-DEV.506". +# However, there is a release with this definition, so we need to keep it around +# to avoid breakage. if VERSION < v"1.1.0-DEV.506" range(start, stop; kwargs...) = range(start; stop=stop, kwargs...) +else + function __init__() + @eval Base begin + range(start, stop; kwargs...) = range(start; stop=stop, kwargs...) + end + end end include("deprecated.jl") diff --git a/src/deprecated.jl b/src/deprecated.jl index 613415f64..908451f68 100644 --- a/src/deprecated.jl +++ b/src/deprecated.jl @@ -51,3 +51,7 @@ else import Base.@irrational import Base.LinAlg.BLAS.@blasfunc end + +# to be deprecated: + +# * `range(start, stop)` (without either `length` nor `step` given)