Skip to content

Commit

Permalink
Revert "Add function-first finalizers (#416)"
Browse files Browse the repository at this point in the history
This reverts commit 5ab47d1 due to
method ambiguities.
  • Loading branch information
ararslan committed Dec 1, 2017
1 parent 4aaff07 commit f3ae82d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,6 @@ Currently, the `@compat` macro supports the following syntaxes:

* `Uninitialized` and `uninitialized` with corresponding `Array` constructors ([#24652]).

* `finalizer` accepts the finalizer to run as the first argument and the object to be finalized
as the second ([#24605])

## Renaming


Expand Down Expand Up @@ -369,6 +366,5 @@ includes this fix. Find the minimum version from there.
[#24282]: https://github.com/JuliaLang/julia/issues/24282
[#24372]: https://github.com/JuliaLang/julia/issues/24372
[#24459]: https://github.com/JuliaLang/julia/issues/24459
[#24605]: https://github.com/JuliaLang/julia/issues/24605
[#24652]: https://github.com/JuliaLang/julia/issues/24652
[#24657]: https://github.com/JuliaLang/julia/issues/24657
8 changes: 0 additions & 8 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -825,14 +825,6 @@ end
export Uninitialized, uninitialized
end

if VERSION < v"0.7.0-DEV.2562"
import Base: finalizer
finalizer(f::Function, o) = finalizer(o, f)
finalizer(f::Ptr{Void}, o) = finalizer(o, f)
finalizer(f::Ptr{Void}, o::Ptr{Void}) = invoke(finalizer, Tuple{Ptr{Void}, Any}, f, o)
finalizer(f::Ptr{Void}, o::Function) = invoke(finalizer, Tuple{Ptr{Void}, Any}, f, o)
end

include("deprecated.jl")

end # module Compat
11 changes: 1 addition & 10 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,7 @@ let a = [1 0 0; 0 1 0; 0 0 1]
@test SparseMatrixCSC{Complex128,Int8}(I, 3, 2)::SparseMatrixCSC{Complex128,Int8} == a[:,1:2]
end


# 0.7.0-DEV.2581
@test isa(Vector(uninitialized, 2), Vector{Any})
@test isa(Vector{Float64}(uninitialized, 2), Vector{Float64})
Expand All @@ -916,16 +917,6 @@ module Test24361
using Compat.Test
@test String(Compat.Base64.base64decode("SGVsbG8h")) == "Hello!"
end
# 0.7
let A = [1]
local x = 0
finalizer(a->(x+=1), A)
finalize(A)
@test x == 1
A = 0
gc(); gc()
@test x == 1
end

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

0 comments on commit f3ae82d

Please sign in to comment.