Skip to content

Error printing integers with nothing #5

@mcabbott

Description

@mcabbott
julia> [1,2,3,nothing,4]
5-element Vector{Union{Nothing, Int64}}:
 1         #    ┝━━━━━━━━
 2         #    ┝━━━━━━━━━━━━━━━━╸
 3         #    ┝━━━━━━━━━━━━━━━━━━━━━━━━╸
  nothing  #  Error showing value of type Vector{Union{Nothing, Int64}}:

SYSTEM (REPL): showing an error caused an error
ERROR: 1-element ExceptionStack:
MethodError: no method matching isfinite(::Nothing)
The function `isfinite` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  isfinite(::Missing)
   @ Base missing.jl:101
  isfinite(::BigFloat)
   @ Base mpfr.jl:1048
  isfinite(::FixedPointNumbers.FixedPoint)
   @ FixedPointNumbers ~/.julia/packages/FixedPointNumbers/Dn4hv/src/FixedPointNumbers.jl:102
  ...

Stacktrace:
  [1] print_matrix_row(io::IOContext{…}, X::AbstractVector, A::Vector{…}, i::Int64, cols::Vector{…}, ::Tuple{…}, idxlast::Int64)
    @ InTheRed ~/.julia/dev/InTheRed/src/InTheRed.jl:391
  [2] _print_matrix(io::IOContext{…}, X::AbstractVecOrMat, pre::String, sep::Tuple{…}, post::String, hdots::String, vdots::String, ddots::String, hmod::Int64, vmod::Int64, rowsA::UnitRange{…}, colsA::UnitRange{…})
    @ Base ./arrayshow.jl:213
  [3] print_matrix(io::IOContext{…}, X::AbstractVector{…}, pre::String, sep::String, post::String, hdots::String, vdots::String, ddots::String, hmod::Int64, vmod::Int64)
    @ InTheRed ~/.julia/dev/InTheRed/src/InTheRed.jl:339
  [4] print_matrix
    @ ~/.julia/dev/InTheRed/src/InTheRed.jl:337 [inlined]
  [5] print_array
    @ ./arrayshow.jl:358 [inlined]
  [6] show(io::IOContext{Base.TTY}, ::MIME{Symbol("text/plain")}, X::Vector{Union{Nothing, Int64}})
    @ Base ./arrayshow.jl:399

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions