Skip to content

Enum can't be displayed in REPL #37401

@MarcMush

Description

@MarcMush

trying to show Enum in the REPL throws an error, apparently because it's not a DataType
seems to be broken from 1.3 to 1.5 (I didn't try on master)

(I stumbled across this when trying to see subtypes(Any)

julia> println(Enum)
Enum

julia> Enum isa DataType
false

julia> Enum
Enum Error showing value of type UnionAll:
ERROR: MethodError: no method matching show_datatype(::IOContext{REPL.Terminals.TTYTerminal}, ::Type{Enum})
Closest candidates are:
  show_datatype(::IO, ::DataType) at show.jl:596
Stacktrace:
 [1] show(::IOContext{REPL.Terminals.TTYTerminal}, ::MIME{Symbol("text/plain")}, ::Type{Enum}) at ./Enums.jl:52
 [2] display(::REPL.REPLDisplay{REPL.LineEditREPL}, ::MIME{Symbol("text/plain")}, ::Type{T} where T) at /home/marc/.julia/packages/OhMyREPL/7qVFi/src/output_prompt_overwrite.jl:6
 [3] display(::REPL.REPLDisplay, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:218
 [4] display(::Any) at ./multimedia.jl:328
 [5] #invokelatest#1 at ./essentials.jl:710 [inlined]
 [6] invokelatest at ./essentials.jl:709 [inlined]
 [7] print_response(::IO, ::Any, ::Bool, ::Bool, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:238
 [8] print_response(::REPL.AbstractREPL, ::Any, ::Bool, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:223
 [9] (::REPL.var"#do_respond#54"{Bool,Bool,REPL.var"#64#73"{REPL.LineEditREPL,REPL.REPLHistoryProvider},REPL.LineEditREPL,REPL.LineEdit.Prompt})(::Any, ::Any, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:822
 [10] #invokelatest#1 at ./essentials.jl:710 [inlined]
 [11] invokelatest at ./essentials.jl:709 [inlined]
 [12] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/LineEdit.jl:2355
 [13] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/REPL/src/REPL.jl:1143
 [14] (::REPL.var"#38#42"{REPL.LineEditREPL,REPL.REPLBackendRef})() at ./task.jl:356

julia> versioninfo()
Julia Version 1.5.0
Commit 96786e22cc (2020-08-01 23:44 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behaviordisplay and printingAesthetics and correctness of printed representations of objects.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions