Skip to content

Commit

Permalink
Support isassigned(::RefValue)
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Apr 6, 2017
1 parent e3ba915 commit 4ab9793
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,11 @@ if VERSION < v"0.6.0-dev.838"
Base.convert{T}(::Type{Set{T}}, s::Set) = Set{T}(s)
end

# https://github.com/JuliaLang/julia/pull/18082
if VERSION < v"0.6.0-dev.2347"
Base.isassigned(x::Base.RefValue) = isdefined(x, :x)
end

include("to-be-deprecated.jl")

end # module Compat
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1805,6 +1805,10 @@ let
@test cssset == Set(["foo", "bar"])
end

# PR 18082
@test !isassigned(Ref{String}())
@test isassigned(Ref{String}("Test"))

include("to-be-deprecated.jl")

nothing

0 comments on commit 4ab9793

Please sign in to comment.