Expression of this type cannot be used to index the array

In reply to desperadorocks:

my_pts = '{'h11, 'h22} // code display



module assoc_array_cycling;
 class config;
  rand bit [7:0]my_pts[]; // using dynamic array instead of queue
 endclass: config
 
 class aac;
  config   cfg;
 
  bit[7:0] agt_pts[string][$] = '{"alu0":'{'h11}, "cpu0":'{'h11,'h22}}; // your assignment is wrong
 
  function perform_opr;
    cfg = new();
    
    assert(cfg.randomize with { 
           cfg.my_pts.size() == agt_pts["cpu0"].size();
 
      foreach(my_pts[z]) // walking dynamic array
             my_pts[z] == agt_pts["cpu0"][z];
 
    }) else $display("Randomization failed");

    $display("my_pts = %p", cfg.my_pts);
  endfunction: perform_opr
 endclass: aac 
 
 initial begin
   aac aac_inst = new();
 
   aac_inst.perform_opr();
 end
endmodule: assoc_array_cycling