As skyhan wrote, an open array is something else then a dynamic array.
Setlength is a bit more explicit in its documentation and mentions that var a must be of "DynArrayType", which (as you showed correctly in your first routine) has to be declared specifically as type.
Your second routine is indeed using an open array as parameter.