Skip to content

Base.show fails with structural matrices with non-number elements #1013

Open
JuliaLang/julia
#50391
@longemen3000

Description

@longemen3000

Some matrices (SparseMatrixCSC and Diagonal, as far as i know) depend on a type defining iszero(x::T) and zero(Type{T}) to work. a MWE:

show(IOBuffer(),MIME"text/plain"(),Diagonal(fill(nothing,3)))

version info.

julia> versioninfo()
Julia Version 1.9.1
Commit 147bdf428c (2023-06-07 08:27 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Core(TM) i7-4720HQ CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, haswell)
  Threads: 4 on 8 virtual cores
Environment:
  JULIA_NUM_THREADS = 4

related:

korsbo/Latexify.jl#269

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrays[a, r, r, a, y, s]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions