This works by translating it to a $size() system function call. The $size function is already implemented for dynamic queues and it is easy enough to expand it for queues.
This includes limited support for dynamic arrays down to the code generator, and some stubs in the vvp code generator and vvp run time.