Skip to content

Commit

Permalink
Add compat for AbstractRange
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyichao committed Sep 14, 2017
1 parent 9561962 commit e7f49d1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Currently, the `@compat` macro supports the following syntaxes:

* `retry` for the more flexible `retry` method introduced in 0.6 which includes support for kwargs ([#19331], [#21419]).

## Renamed functions
## Renamed functions and types


* `$` is now `xor` or `` ([#18977])
Expand All @@ -182,6 +182,7 @@ Currently, the `@compat` macro supports the following syntaxes:
`read(::IO, ::Type{String})`, `read(::AbstractString, ::Type{String})`,
and `read(::Cmd, ::Type{String})` are defined for 0.6 and below.

* `Range` is now `AbstractRange` ([#23570])

## New macros

Expand Down Expand Up @@ -305,3 +306,4 @@ includes this fix. Find the minimum version from there.
[#22751]: https://github.com/JuliaLang/julia/issues/22751
[#22761]: https://github.com/JuliaLang/julia/issues/22761
[#22864]: https://github.com/JuliaLang/julia/issues/22864
[#23570]: https://github.com/JuliaLang/julia/issues/23570
6 changes: 6 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,12 @@ if VERSION < v"0.7.0-DEV.1285"
Base.OverflowError(msg) = OverflowError()
end

# 0.7.0-DEV.1721
@static if !isdefined(Base, :AbstractRange)
const AbstractRange = Range
export AbstractRange
end

include("deprecated.jl")

end # module Compat
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,9 @@ no_specialize(@nospecialize(x::Integer)) = sin(2)
@test contains(read(@__FILE__, String), "read(@__FILE__, String)")
@test read(`$(Base.julia_cmd()) --startup-file=no -e "println(:aaaa)"`, String) == "aaaa\n"

# 0.7
@test isa(1:2, AbstractRange)

if VERSION < v"0.6.0"
include("deprecated.jl")
end
Expand Down

0 comments on commit e7f49d1

Please sign in to comment.