Bug in Nullable?

Tried

isfinite(Nullable(1))

Get error

ERROR: MethodError: no method matching isfinite(::Nullable{Int64})
Closest candidates are:
  isfinite(::Float16) at float.jl:539
  isfinite(::BigFloat) at mpfr.jl:831
  isfinite(::LastMain.LastMain.DataArrays.NAtype) at /Users/brent/.julia/v0.6/DataArrays/src/predicates.jl:10
  ...

Version is

julia> versioninfo()
Julia Version 0.6.0
Commit 903644385b (2017-06-19 13:05 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)

It’s not generally the case that a method defined for some type T will also work on Nullable{T}. You can use get() to retrieve the underlying integer:

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

julia> isfinite(get(n))
true

or use broadcasting to get a Nullable result:

julia> isfinite.(n)
Nullable{Bool}(true)
3 Likes