Can I pass unknown size of unpacked array of packed array to a function?

I know that I can pass unknown size of packed array to function and change the array by inout.
For example:
The function is:

function void foo_arr_bit (inout bit [31:0] mem, input int size, string  mem_name);
      for (int i=0; i< size(); i++)
           mem[i] = my_randomize_int(mem[i], mem_name);     
endfunction: foo_arr_bit

Call the function:

foo_arr_bit (data_bit, 8, "data_bit");

But can I pass unknown size of unpacked array of packed array to a function?
I tried the following:

function void foo_arr_bit (int seed, inout bit [31:0] q [$], input string mem_name, int arr_size, const ref int vec_bit_siz);
      for (int i=0; i< size(); i++)
           mem[i] = my_randomize_int(mem[i], mem_name);     
endfunction: foo_arr_bit

Call the function:

foo_arr_bit (seed, arr_vec_bit, "arr_vec_bit", t_data_bit, 9, arr_vec_b_size);

Where:

   bit [9:0]   arr_vec_bit [$];
   int arr_vec_b_size = 10;

And got the following error:

** Error (suppressible): (vlog-7034) …\sv\trx.sv(31): Array assignment to type ‘bit[31:0] []’ from type ‘bit[9:0] []’: Ar
. ‘q’ of ‘my_randomize_array_vec_bit’: Element widths (32, 10) don’t match

Where line 32 is the function call.

In reply to saritr:

There is a mismatch in formal and actual arguments. Actual argument is a queue of bit [9:0]. While formal argument is of queue of bit [31:0].

In reply to sharvil111:

I know, but inot argument doesn’t need to know the origin size (look at te first example, with the paked array).

In reply to saritr:
unpacked arrays are strong types. You can’t assign one to another if their shape does not match.

In reply to dave_59:

Is there any other way to implement what I want?

In reply to saritr:

In reply to sharvil111:
I know, but inot argument doesn’t need to know the origin size (look at te first example, with the paked array).

**As Dave mentioned, inout and ref arguments are strong typed in SystemVerilog.
**

A strongly-typed programming language is one in which each type of data (such as integer, character, hexadecimal, packed decimal, and so forth) is predefined as part of the programming language and all constants or variables defined for a given program must be described with one of the data types.