Here’s a short dummy example of what I want to do:

```
functions {
vector[] sim(real r1, vector v1) {
vector[2] v2 = to_vector({2.0, 4.0});
// do stuff
return({v1*r1, v2});
}
}
transformed parameters {
vector[2] v1 = to_vector({1.0, 2.0});
vector[2] sim_result[2];
sim_result = sim(2, v1);
print(sim_result)
}
```

The function `sim`

is supposed to return an array of vectors. It works fine when exposed to R with `expose_stan_functions`

. But doesn’t compile when the function is called in the model or transformed parameters block. The error message is very long, but starts with “ERROR(s) during compilation: source code errors or compiler configuration errors!”.

Is it possible to return an array of vectors from a function or do i need to convert to something else first, like a matrix?