// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#using <mscorlib.dll>

using namespace System;

ref class A
{
    private:
        void foo() { Console::WriteLine("OK"); };
        friend class B; // <-------------------------- DOES NOT COMPILE !!!!
};

ref class B
{
    private:
        A^ a;
    public:
        B() { a = gcnew A(); };
        void bar() { a->foo(); };
};

int main()
{
    B^ b = gcnew B();
    b->bar();
    return 0;
}
