Doesn't the logic of UFCS rather suggest that this should compile?

struct A
{
   int m;
   void foo(int n) { m += n; }
}

void bar(ref A a, int n)
{
   a.foo(n*n);
}

void delegate(int) dg = &bar;

void main()
{
   A a;
   a.bar(3);
   dg(3);
   assert(a.m == 18);
}

Reply via email to