System.Console.WriteLine(new A.B().X());
class A {
private string Foo() => "bar";
public class B {
public string X() => new A().Foo();
}