Local variable access in class

In the below example, children queue of components is declared as local variable. That means only the base class/class where it is defined has visibility to it. So in constructor/printc methods, how are we able to access children via . operator [parent.children]? It should only be accessed via class methods, correct?

class component;
	local component children[$];
	int b=5;
	function new  (string name, component parent);
		if (parent!=null) begin
			$display("p id = %d", parent.b);
		        parent.children.push_back(this);
		end
	endfunction
	function printc(component parent);
                if (parent!=null)
			$display("children=%p",parent.children);
	endfunction
endclass

class mycomponent extends component;
function new (string name, component parent);
	super.new(name, parent);
endfunction

endclass

In reply to svq:

In OOP, this is known as a friendly member access. See section 8.18 Data hiding and encapsulation in the IEEE 1800-2017 SystemVerilog LRM.

In reply to dave_59:

Thanks Dave. Thanks for pointing to the LRM section as well. I couldn’t find reasoning for this scenario anywhere online apart from the LRM section you pointed out.

In reply to svq:

I believe Dave_59 is pointing to this below statement copied from 8.18 Data hiding and encapsulation in the IEEE 1800-2017 SystemVerilog LRM.

A member identified as local is available only to methods inside the class. Further, these local members are not visible within subclasses. Of course, nonlocal methods that access local class properties or methods can be inherited and work properly as methods of the subclass.