Skip to content

Commit

Permalink
Drop compat code for InexactError, DomainError, and `OverflowErro…
Browse files Browse the repository at this point in the history
…r` constructors from #393
  • Loading branch information
martinholters committed Oct 1, 2019
1 parent 21a3028 commit 30575ee
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 28 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ Currently, the `@compat` macro supports the following syntaxes:

* `isnothing` for testing if a variable is equal to `nothing` ([#29674]).

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

* `Base.rtoldefault` how takes a third parameter `atol`.
The two argument form is deprecated in favor of the three arguments form with `atol=0`.

Expand Down
16 changes: 0 additions & 16 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,6 @@ end

include("compatmacro.jl")

# 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

if VERSION < v"0.7.0-DEV.755"
# This is a hack to only add keyword signature that won't work on all julia versions.
# However, since we really only need to support a few (0.5, 0.6 and early 0.7) versions
Expand Down
10 changes: 10 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,13 @@ let cmd = `$(Base.julia_cmd()) --startup-file=no -e "println(:aaaa)"`
@test read(cmd, String) == "aaaa\n"
@test read(pipeline(cmd, stderr=devnull), String) == "aaaa\n"
end

# 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"))
10 changes: 0 additions & 10 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,6 @@ if VERSION < v"0.7.0-DEV.880"
end
end

# 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"))

# PR 22907
using Compat: pairs

Expand Down

0 comments on commit 30575ee

Please sign in to comment.