[Issue 3051] Passing alias to member function does not work (1/2)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 5 08:10:40 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3051





--- Comment #5 from Steven Schveighoffer <schveiguy at yahoo.com>  2009-06-05 08:10:38 PDT ---
(In reply to comment #4)
> In fact, I'm now unsure why that can't work for both these bugs too...

One other thing about having two "this" pointers, how come this can work
(tested with dmd 1.043)?

void foo(delegate void() dg)
{
  dg();
}

class C
{
   int y;
   void fun()
   {
       int x = 0;
       void gun()
       { x++; y++; } // 2 this pointers needed here!
       foo(&gun);
   }
}

So probably there should be no conflict.  And the "this" pointer of the alias'd
function in the bug's example should be statically calculatable, so it doesn't
need to occupy a register.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list