Skip to content

Fix show for IndexMap #843

@blegat

Description

@blegat

Now that IndexMap is a subtype of AbstractDict, displaying it results in an error:

julia> MOI.Utilities.IndexMap()
Error showing value of type MathOptInterface.Utilities.IndexMap:
ERROR: MethodError: no method matching length(::MathOptInterface.Utilities.IndexMap)
Closest candidates are:
  length(::Core.SimpleVector) at essentials.jl:561
  length(::Base.MethodList) at reflection.jl:801
  length(::Core.MethodTable) at reflection.jl:875
  ...
Stacktrace:
 [1] summary(::IOContext{REPL.Terminals.TTYTerminal}, ::MathOptInterface.Utilities.IndexMap) at ./abstractdict.jl:34
 [2] show(::IOContext{REPL.Terminals.TTYTerminal}, ::MIME{Symbol("text/plain")}, ::MathOptInterface.Utilities.IndexMap) at ./show.jl:81

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions