Why local:: operator does not work?

I’m trying to get randomized value from nested class’s variable.
The module tb randomzied a_inst calls class a, then it calls class b.

However, local::a amd and B_rand.a not passed to.

   
    
    class b;
    rand int a;
    constraint a_c {
    	a > 10;
    }
    endclass
    
    class a; 
    b B_rand; 
    rand int a; 
    rand int b;
    
    function new();
    B_rand = new(); 
    B_rand.randomize() with {local::a < B_rand.a;};
    endfunction
    
    endclass
    
    module tb; 
    a a_inst;
    
    initial begin
    a_inst = new();
    a_inst.randomize(); 
    $display("Constraint check %0d",a_inst.a);
    end
   
    endmodule

When I check the a_inst.a value, it is not constrainted.
Could you guide where local::a and B_rand.a refer to and how do I get constratined a_inst.a ?

Even if I declared a = 20; inside instead

class a; 
b B_rand; 
rand int a; 
rand int b;

function new();
B_rand = new(); 
//B_rand.randomize() with {local::a<B_rand.a;};
a = 20;  
endfunction


Still I can’t a=20 value from $display(“Constraint check %0d”,a_inst.a);

In reply to UVM_LOVE:

When you call
B_rand.randomize() with {local::a < B_rand.a;};
inside the constructor of
class a
,
local::a
is 0, and the constraint a_c {a>10;} is already greater than 0. So the with clause has no effect.

There are no constraint on classa member a, so when you call a_inst.randomize();, member a is unconstrained.