February 05, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7585


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich@gmail.com


--- Comment #10 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-02-05 13:08:39 PST ---
What's the state of this? OP sample works, but in Kenji's Comment #1 sample the line which fails is:

Callback cb3 = &Wrap!(f3);      // NG

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 05, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7585


timon.gehr@gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #11 from timon.gehr@gmx.ch 2013-02-05 13:27:23 PST ---
(In reply to comment #10)
> What's the state of this? OP sample works, but in Kenji's Comment #1 sample the line which fails is:
> 
> Callback cb3 = &Wrap!(f3);      // NG

It is to be expected that this fails. If the OP sample works, I assume this is fixed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 05, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7585



--- Comment #12 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-02-05 13:28:09 PST ---
(In reply to comment #11)
> (In reply to comment #10)
> > What's the state of this? OP sample works, but in Kenji's Comment #1 sample the line which fails is:
> > 
> > Callback cb3 = &Wrap!(f3);      // NG
> 
> It is to be expected that this fails. If the OP sample works, I assume this is fixed.

I guess he also expects this to fail then:

Callback cb3 = &Wrap!((){});    // NG

but it doesn't fail.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 05, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7585



--- Comment #13 from timon.gehr@gmx.ch 2013-02-05 13:32:58 PST ---
(In reply to comment #12)
> (In reply to comment #11)
> > (In reply to comment #10)
> > > What's the state of this? OP sample works, but in Kenji's Comment #1 sample the line which fails is:
> > > 
> > > Callback cb3 = &Wrap!(f3);      // NG
> > 
> > It is to be expected that this fails. If the OP sample works, I assume this is fixed.
> 
> I guess he also expects this to fail then:
> 
> Callback cb3 = &Wrap!((){});    // NG
> 
> but it doesn't fail.

This should work. What he wanted to show is that (){ } currently behaves like f3, while it should behave like f1 or f2.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 06, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7585



--- Comment #14 from Kenji Hara <k.hara.pg@gmail.com> 2013-02-05 17:19:33 PST ---
(In reply to comment #10)
> What's the state of this? OP sample works, but in Kenji's Comment #1 sample the line which fails is:
> 
> Callback cb3 = &Wrap!(f3);      // NG

The sample in comment#1 was shown old broken compiler behavior.

>    Callback cb1 = &Wrap!(f1);      // OK
>    Callback cb2 = &Wrap!(f2);      // OK

The Wrap function inside Wrap template is declared with extern(C). So it cannot
have any hidden context pointer. And, calling f1 or f2 will not need such extra
pointer, then Wrap!(f1) and Wrap!(f2) will succeed to compile.

>    Callback cb3 = &Wrap!(f3);      // NG

f3 is a nested function. So the Wrap function should get a hidden context to main function, but it is impossible. Then the instantiation Wrap!(f3) will fail.

>    Callback cb3 = &Wrap!((){});    // NG

This should be compiled. The lambda function (){} has no outer context access, so it should not be treated as nested. But, it had been accidentally done.

As a conclusion, current compiler works as expected. This bug is already fixed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
1 2
Next ›   Last »