class A;
rand B B1_h1;
rand B B1_h2;
function new();
B1_h1 = new();
B1_h2 = B1_h1;
endfunction
endclass
A a1 = new();
a1.randomize() with { // B1_h1.member constraint };
Will the constraints to B1_h1 also apply to B1_h2?
class A;
rand B B1_h1;
rand B B1_h2;
function new();
B1_h1 = new();
B1_h2 = B1_h1;
endfunction
endclass
A a1 = new();
a1.randomize() with { // B1_h1.member constraint };
Will the constraints to B1_h1 also apply to B1_h2?
Yes, there is only one object.