Not able to constraint the size of the associative array in inline constraint

2 module tb;
3
4 class example;
5 rand int ass_arry[int];
6 endclass
7
8 example obj = new;
9 initial begin
10 assert(obj.randomize() with { ass_arry.size() == 2; });
11 $display(“size ass_arry.size : %d \n”, obj.ass_arry.size() );
12 $finish;
13 end
14
15 endmodule

Note : i am using modelsim 10.1d
But if i uses dynamic array it works fine. Please let me know, if i does any mistake

It’s not legal to constrain the size of an associative array. Only dynamic arrays and queues which have contiguous indexed elements.