let element: i32 = some_integer_array(i);
let reference: &i32 = &some_integer_array(i);
work. In particular, the second one should give a reference to the element inside the array. I believe Scala doesn't have to deal with this subtlety, since everything is a pointer and generally the precise location of things in memory isn't so important.This issue is definitely not insurmountable, but it is also definitely not a simple direct replacement.