Skip to content

Commit

Permalink
Drop compat code for fieldcount from #386
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Oct 8, 2019
1 parent 3702883 commit 4115e15
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ Currently, the `@compat` macro supports the following syntaxes:

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

* `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]).

* `Base.rtoldefault` how takes a third parameter `atol`.
Expand Down
5 changes: 0 additions & 5 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ end

include("compatmacro.jl")

@static if VERSION < v"0.7.0-DEV.892"
fieldcount(t) = nfields(t)
export fieldcount
end

if VERSION < v"0.7.0-DEV.1053"
Base.read(obj::IO, ::Type{String}) = readstring(obj)
Base.read(obj::AbstractString, ::Type{String}) = readstring(obj)
Expand Down
8 changes: 8 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,11 @@ let coolvec = [1,2,3]
@test pushfirst!(coolvec, 0) == [0,1,2,3]
@test popfirst!(coolvec) == 0
end

# PR 22350
struct TestType
a::Int
b
end
@test fieldcount(TestType) == 2
@test fieldcount(Int) == 0
5 changes: 0 additions & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ if VERSION < v"0.7.0-DEV.880"
end
end

# PR 22350
eval(Expr(struct_sym, 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))

Expand Down

0 comments on commit 4115e15

Please sign in to comment.