www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8113] New: alias this doesn't forward opCall

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8113

           Summary: alias this doesn't forward opCall
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: wfunction hotmail.com



And, in fact, opDispatch doesn't do that, either.

Both of them should treat opCall like a normal member.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 17 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8113




Please give us an actual and possible reduced code. otherwise, this might
become useless report.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 17 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8113




struct C { void opCall() { } }
struct A { C c; alias c this; }
void main() { A f; f(); }

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 17 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8113




And regarding opDispatch:

struct C { void opDispatch(string op, T...)(T) { } }
void main() { C f; f(); }

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 17 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8113


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid




 struct C { void opCall() { } }
 struct A { C c; alias c this; }
 void main() { A f; f(); }
Hmm, thank you. I'll try to fix the issues this weekend.
 And regarding opDispatch:
 
 struct C { void opDispatch(string op, T...)(T) { } }
 void main() { C f; f(); }
I'm not sure this is valid. With current implementation, opDispatch cannot forward operator overloading like f.opDispatch!"opUnary". I think this is an enhancement issue about opDispatch feature. Creating new issue is better IMO. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 17 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8113




Thanks.

Just wondering, why is the second one an 'enhancement'? Isn't opUnary just a
member, which should also be opDispatch'ed?

(I'm figuring that the only members which should not be opDispatch'able are:
opDispatch itself, the constructors, and the destructor. Anything else, by
definition, is dispatched on the object.)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 17 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8113





 Thanks.
 
 Just wondering, why is the second one an 'enhancement'? Isn't opUnary just a
 member, which should also be opDispatch'ed?
Today these forwarding doesn't work at all. struct S { void opDispatch(string op, A...)(A args){} } void main() { S s; +s; // not converted to opDispatch!("opUnary", ...) s + s; // not converted to opDispatch!("opBinary", ...) s(); // not converted to opDispatch!("opCall", ...) } So I think this is an enhancement rather than a bug.
 (I'm figuring that the only members which should not be opDispatch'able are:
 opDispatch itself, the constructors, and the destructor. Anything else, by
 definition, is dispatched on the object.)
I think no. At least, constructor and destructor have some special features (e.g. can modify const members for construction), but opDispatch doesn't. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 17 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8113





 Today these forwarding doesn't work at all.
lol I imagined that was the bug. I guess you could call it the lack of a feature too haha. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 18 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8113


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|alias this and opDispatch() |alias this doesn't forward
                   |don't forward opCall        |opCall



I separated issues about opDispatch.

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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 19 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8113


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



https://github.com/D-Programming-Language/dmd/pull/956

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 19 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8113




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/3444b9cb5324d0b9e36282b9dc73b31f4c711ad8
fix Issue 8113 - alias this doesn't forward opCall

https://github.com/D-Programming-Language/dmd/commit/417b793be589e95f923b54652ec408a106cbc7e6


Issue 8113 - alias this doesn't forward opCall

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 20 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8113


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


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