Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug printing iterable index sets #795

Closed
mlubin opened this issue Jun 23, 2016 · 0 comments · Fixed by #816
Closed

bug printing iterable index sets #795

mlubin opened this issue Jun 23, 2016 · 0 comments · Fixed by #816
Labels
Milestone

Comments

@mlubin
Copy link
Member

mlubin commented Jun 23, 2016

julia> using JuMP

julia> m = Model()
Feasibility problem with:
 * 0 linear constraints
 * 0 variables
Solver is default solver

julia> d = Dict(:a => 1)
Dict{Symbol,Int64} with 1 entry:
  :a => 1

julia> @variable(m, x[keys(d)])
x[i] free ∀ i  {}

julia> @variable(m, y[1:2])
2-element Array{JuMP.Variable,1}:
Error showing value of type Array{JuMP.Variable,1}:
ERROR: MethodError: `getindex` has no method matching getindex(::Base.KeyIterator{Dict{Symbol,Int64}}, ::Int64)
 in fill_var_names at /home/mlubin/.julia/v0.4/JuMP/src/print.jl:314
 in var_str at /home/mlubin/.julia/v0.4/JuMP/src/print.jl:302
 in showcompact_lim at show.jl:120
 in sprint at iostream.jl:206
 in alignment at show.jl:1012
 in print_matrix at show.jl:1087
 in print_matrix at show.jl:1079
 in anonymous at replutil.jl:23
 in with_output_limit at ./show.jl:1276
 in writemime at replutil.jl:23
 in display at REPL.jl:114
 in display at REPL.jl:117
 [inlined code] from multimedia.jl:151
 in display at multimedia.jl:163
 in print_response at REPL.jl:134
 in print_response at REPL.jl:121
 in anonymous at REPL.jl:624
 in run_interface at ./LineEdit.jl:1610
 in run_frontend at ./REPL.jl:863
 in run_repl at ./REPL.jl:167
 in _start at ./client.jl:420
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

1 participant