diff --git a/base/nullable.jl b/base/nullable.jl index fcdd29bad68e9..ee74abca73c7c 100644 --- a/base/nullable.jl +++ b/base/nullable.jl @@ -15,7 +15,7 @@ eltype{T}(::Type{Nullable{T}}) = T eltype{T}(x::Nullable{T}) = T -function convert{S, T}(::Type{Nullable{T}}, x::Nullable{S}) +function convert{T}(::Type{Nullable{T}}, x::Nullable) return isnull(x) ? Nullable{T}() : Nullable(convert(T, get(x))) end @@ -29,11 +29,11 @@ end get(x::Nullable) = x.isnull ? throw(NullException()) : x.value -get{S, T}(x::Nullable{S}, y::T) = x.isnull ? convert(S, y) : x.value +get{T}(x::Nullable{T}, y) = x.isnull ? convert(T, y) : x.value isnull(x::Nullable) = x.isnull -function isequal{S, T}(x::Nullable{S}, y::Nullable{T}) +function isequal(x::Nullable, y::Nullable) if x.isnull && y.isnull return true elseif x.isnull || y.isnull @@ -43,7 +43,7 @@ function isequal{S, T}(x::Nullable{S}, y::Nullable{T}) end end -=={S, T}(x::Nullable{S}, y::Nullable{T}) = throw(NullException()) +==(x::Nullable, y::Nullable) = throw(NullException()) const nullablehash_seed = UInt === UInt64 ? 0x932e0143e51d0171 : 0xe51d0171 diff --git a/doc/stdlib/base.rst b/doc/stdlib/base.rst index 7f5ee13592bc2..02242d403ef8b 100644 --- a/doc/stdlib/base.rst +++ b/doc/stdlib/base.rst @@ -1321,7 +1321,7 @@ Nullables .. function:: isnull(x) - Does the ``Nullable`` object ``x`` have a value or not? + Is the ``Nullable`` object ``x`` null, i.e. missing a value? Strings -------