Collection of JuMP variables

Are you sure it won’t work the simple way? It seems to for me:

julia> f(i) = 2i -1
f (generic function with 1 method)

julia> using JuMP

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

julia> @variable(m, y[i = 1:3, j = 1:f(i)] >= 0, start = i + j)
y[i,j] >= 0 for all i in {1,2,3}, j in {..}

julia> getvalue(y)
y: 2 dimensions, 9 entries:
 [1,1] = 2.0
 [2,1] = 3.0
 [2,2] = 4.0
 [2,3] = 5.0
 [3,1] = 4.0
 [3,2] = 5.0
 [3,3] = 6.0
 [3,4] = 7.0
 [3,5] = 8.0

Do you get an error if you try that?