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 2d0f590 commit 5e4fe74
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 @@ -1423,6 +1423,11 @@ if VERSION < v"0.6.0-dev.2283"
end
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 @@ -1768,4 +1768,8 @@ end
@test Compat.readline(IOBuffer("x\n"), chomp=true) == "x"
@test Compat.readline(IOBuffer("x\n"), chomp=false) == "x\n"

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

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

0 comments on commit 5e4fe74

Please sign in to comment.