JuMP - MethodError: `getindex` has no method matching getindex(::Function, ::Int64)
<p>I have to calculate the ideal vector of this multiobjective problem. I cannot how to access the first and second function of the functs_BK1() in the @objective. 
Any Idea how I could make all dynamic and support n-functions?</p>

<pre><code>using JuMP
using Ipopt


function functs_BK1(x::Vector)
    f = zeros(2)
    f[1] = x[1]^2 + x[2]^2
    f[2] = (x[1]-5.0)^2 + (x[2]-5.0)^2

    return f
end

function bounds_BK1()
    return ([-5.0;-5.0],[10.0;10.0])
end


m = Model(solver=IpoptSolver(print_level=0))
@variable(m, x[i=1:2])

@NLexpression(m, F1, functs_BK1()[1]) #&lt;--- Problem is here
@NLexpression(m, F2, functs_BK1()[2]) #&lt;--- here

@constraint(m, x .&gt;= bounds_BK1()[1])
@constraint(m, x .&lt;= bounds_BK1()[2])
s=solve(m)
</code></pre>