# MethodError: no method matching getindex in JuliaPro

**URL:** <https://discourse.julialang.org/t/methoderror-no-method-matching-getindex-in-juliapro/48504>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [October 16, 2020, 5:53pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-getindex-in-juliapro/48504 "2020-10-16T17:53:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RaquelSantos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/raquelsantos/32/3668_2.png) [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Post date:** [October 16, 2020, 5:53pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-getindex-in-juliapro/48504/1 "2020-10-16T17:53:09Z")

</div>

How to get out of this error?

```julia
MethodError: no method matching getindex (:: ConstraintRef {Model, JuMP.GenericRangeConstraint {JuMP.GenericAffExpr {Float64, Variable}}}, :: Int64, :: Int64)

```

---

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [October 16, 2020, 6:31pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-getindex-in-juliapro/48504/2 "2020-10-16T18:31:13Z")

</div>

Seems you tried to index a constraint object in a 2D fashion, for example, given `c` is the constraint object, you did, `c[1, 1]`. I am not sure what you wanted by trying to access a position inside a constraint, so I cannot help you out of this error.
