Skip to content

Commit

Permalink
Showing 3 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -159,6 +159,8 @@ Currently, the `@compat` macro supports the following syntaxes:
* `fieldcount` is equivalent to `nfields` for Julia versions 0.6 and below and is used to
determine the number of fields in a data type ([#22350]).

* There are versions of `InexactError`, `DomainError`, and `OverflowError` that take the same arguments as introduced in Julia 0.7-DEV ([#20005], [#22751], [#22761]).

## Renamed functions


@@ -311,11 +313,14 @@ includes this fix. Find the minimum version from there.
[#20974]: https://github.com/JuliaLang/julia/issues/20974
[#21257]: https://github.com/JuliaLang/julia/issues/21257
[#21346]: https://github.com/JuliaLang/julia/issues/21346
[#22005]: https://github.com/JuliaLang/julia/issues/22005
[#22064]: https://github.com/JuliaLang/julia/issues/22064
[#22182]: https://github.com/JuliaLang/julia/issues/22182
[#22350]: https://github.com/JuliaLang/julia/issues/22350
[#22475]: https://github.com/JuliaLang/julia/issues/22475
[#22633]: https://github.com/JuliaLang/julia/issues/22633
[#22629]: https://github.com/JuliaLang/julia/issues/22629
[#22666]: https://github.com/JuliaLang/julia/pull/22666
[#22751]: https://github.com/JuliaLang/julia/pull/22751
[#22761]: https://github.com/JuliaLang/julia/pull/22761
[#22864]: https://github.com/JuliaLang/julia/pull/22864
16 changes: 16 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
@@ -488,6 +488,22 @@ if VERSION < v"0.7.0-DEV.1053"
Base.read(obj::Cmd, ::Type{String}) = readstring(obj)
end

# https://github.com/JuliaLang/julia/pull/20005
if VERSION < v"0.7.0-DEV.896"
Base.InexactError(name::Symbol, T, val) = InexactError()
end

# https://github.com/JuliaLang/julia/pull/22751
if VERSION < v"0.7.0-DEV.924"
Base.DomainError(val) = DomainError()
Base.DomainError(val, msg) = DomainError()
end

# https://github.com/JuliaLang/julia/pull/22761
if VERSION < v"0.7.0-DEV.1285"
Base.OverflowError(msg) = OverflowError()
end

include("deprecated.jl")

end # module Compat
10 changes: 10 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -658,6 +658,16 @@ eval(Expr(:type, false, :TestType, Expr(:block, :(a::Int), :b)))
@test fieldcount(TestType) == 2
@test fieldcount(Int) == 0

# PR 20005
@test_throws InexactError throw(InexactError(:func, Int, 3.2))

# PR 22751
@test_throws DomainError throw(DomainError(-2))
@test_throws DomainError throw(DomainError(-2, "negative"))

# PR 22761
@test_throws OverflowError throw(OverflowError("overflow"))

let x = fill!(StringVector(5), 0x61)
# 0.7
@test pointer(x) == pointer(String(x))

0 comments on commit 4f24102

Please sign in to comment.