Skip to content

Commit

Permalink
Revert "add nulled constant, closes #9364"
Browse files Browse the repository at this point in the history
This reverts commit c966812.
  • Loading branch information
JeffBezanson committed Feb 18, 2015
1 parent 7535258 commit 30cc131
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 13 deletions.
1 change: 0 additions & 1 deletion base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,6 @@ export

# nullable types
isnull,
nulled,

# Macros
@__FILE__,
Expand Down
2 changes: 0 additions & 2 deletions base/nullable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ Nullable{T}(value::T) = Nullable{T}(value)

eltype{T}(::Type{Nullable{T}}) = T

const nulled = Nullable{Union()}()

function convert{T}(::Type{Nullable{T}}, x::Nullable)
return isnull(x) ? Nullable{T}() : Nullable{T}(convert(T, get(x)))
end
Expand Down
5 changes: 0 additions & 5 deletions doc/stdlib/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -571,11 +571,6 @@ Nullables

Is the ``Nullable`` object ``x`` null, i.e. missing a value?

.. data:: nulled

A constant ``Nullable`` value in the null (missing value) state. Used, for example,
as a compact way to initialize ``Nullable`` fields: ``x.field = nulled``.


System
------
Expand Down
5 changes: 0 additions & 5 deletions test/nullable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,3 @@ for T in types
@test isa(convert(Nullable{Number}, Nullable(one(T))), Nullable{Number})
@test isa(convert(Nullable{Any}, Nullable(one(T))), Nullable{Any})
end

@test isnull(nulled)
@test_throws NullException get(nulled)
@test isa(convert(Nullable{Int}, nulled), Nullable{Int})
@test isnull(convert(Nullable{Int}, nulled))

0 comments on commit 30cc131

Please sign in to comment.