Skip to content

Commit

Permalink
Fix issues noted in 18484 (#18824)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidagold authored and tkelman committed Oct 8, 2016
1 parent 4dfdf62 commit 9b6ae8c
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions doc/stdlib/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,35 @@ Nullables
julia> isnull(x)
false

.. function:: unsafe_get(x)

.. Docstring generated from Julia source
Return the value of ``x`` for :obj:`Nullable` ``x``\ ; return ``x`` for all other ``x``\ .

This method does not check whether or not ``x`` is null before attempting to access the value of ``x`` for ``x::Nullable`` (hence "unsafe").

.. doctest::

julia> x = Nullable(1)
Nullable{Int64}(1)

julia> unsafe_get(x)
1

julia> x = Nullable{String}()
Nullable{String}()

julia> unsafe_get(x)
ERROR: UndefRefError: access to undefined reference
in unsafe_get(::Nullable{String}) at ./REPL[4]:1

julia> x = 1
1

julia> unsafe_get(x)
1

System
------

Expand Down

0 comments on commit 9b6ae8c

Please sign in to comment.