[Issue 5893] Allow simple aliases for operator overloading

2013-02-06 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5893



--- Comment #8 from Steven Schveighoffer schvei...@yahoo.com 2013-02-06 
08:55:06 PST ---
(In reply to comment #6)
 (In reply to comment #5)
  The OP sample still fails.
 
 The OP sample cannot compile, because ConcatAssignExp will try to instantiate
 opOpAssign!(~). 

In my defense, I believe that originally it DID work the way I specified,
whether it be by design or by accident ;)

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


[Issue 5893] Allow simple aliases for operator overloading

2013-02-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5893



--- Comment #5 from Andrej Mitrovic andrej.mitrov...@gmail.com 2013-02-05 
13:27:26 PST ---
(In reply to comment #4)
 Commits pushed to master at https://github.com/D-Programming-Language/dmd
 
 https://github.com/D-Programming-Language/dmd/commit/8bc59cfe8e6896435f20ce1e9bdcc226942f59a8
 fix Issue 5893 - Allow simple aliases for operator overloading
 
 https://github.com/D-Programming-Language/dmd/commit/2888ec45218e2e49048e9f96be2fa0481dc00e31
 Merge pull request #989 from 9rnsr/fix5893
 
 Issue 5893 - Allow simple aliases for operator overloading

The OP sample still fails.

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


[Issue 5893] Allow simple aliases for operator overloading

2013-02-05 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5893


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


--- Comment #6 from Kenji Hara k.hara...@gmail.com 2013-02-05 17:24:03 PST ---
(In reply to comment #5)
 (In reply to comment #4)
  Commits pushed to master at https://github.com/D-Programming-Language/dmd
  
  https://github.com/D-Programming-Language/dmd/commit/8bc59cfe8e6896435f20ce1e9bdcc226942f59a8
  fix Issue 5893 - Allow simple aliases for operator overloading
  
  https://github.com/D-Programming-Language/dmd/commit/2888ec45218e2e49048e9f96be2fa0481dc00e31
  Merge pull request #989 from 9rnsr/fix5893
  
  Issue 5893 - Allow simple aliases for operator overloading
 
 The OP sample still fails.

The OP sample cannot compile, because ConcatAssignExp will try to instantiate
opOpAssign!(~). Correct sample code is:

class C
{
   void concatAssign(C other) { }
   void concatAssign(int other) { } // to demonstrate overloading

   template opOpAssign(string s) if (s == ~)  // FIXED
   { alias concatAssign opOpAssign; }
}
void main()
{
   auto c = new C;
   c.opOpAssign!~(c); // works
   c.opOpAssign!~(1); // works
   c ~= 1; // line 15
}

So, this bug is already fixed.

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


[Issue 5893] Allow simple aliases for operator overloading

2012-11-22 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5893



--- Comment #4 from github-bugzi...@puremagic.com 2012-11-22 06:24:01 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/8bc59cfe8e6896435f20ce1e9bdcc226942f59a8
fix Issue 5893 - Allow simple aliases for operator overloading

https://github.com/D-Programming-Language/dmd/commit/2888ec45218e2e49048e9f96be2fa0481dc00e31
Merge pull request #989 from 9rnsr/fix5893

Issue 5893 - Allow simple aliases for operator overloading

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


[Issue 5893] Allow simple aliases for operator overloading

2012-06-07 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5893


Kenji Hara k.hara...@gmail.com changed:

   What|Removed |Added

   Keywords||pull


--- Comment #3 from Kenji Hara k.hara...@gmail.com 2012-06-07 00:03:19 PDT ---
https://github.com/D-Programming-Language/dmd/pull/989

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


[Issue 5893] Allow simple aliases for operator overloading

2012-01-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5893


Andrej Mitrovic andrej.mitrov...@gmail.com changed:

   What|Removed |Added

 CC||andrej.mitrov...@gmail.com


--- Comment #1 from Andrej Mitrovic andrej.mitrov...@gmail.com 2012-01-21 
18:19:18 PST ---
Hows this for a workaround:

import std.traits;

class C
{
void concatAssign(C other) { }
void concatAssign(int other) { }

auto ref opOpAssign(string s, T)(T t) if (s == ~)
{
static if (is(ReturnType!concatAssign == void))
concatAssign(t);
else
return concatAssign(t);
}
}

void main()
{
auto c = new C;
c.opOpAssign!~(c); // works
c.opOpAssign!~(1); // works
c ~= 1;  // works
}

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


[Issue 5893] Allow simple aliases for operator overloading

2012-01-21 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=5893


timon.g...@gmx.ch changed:

   What|Removed |Added

 CC||timon.g...@gmx.ch


--- Comment #2 from timon.g...@gmx.ch 2012-01-21 18:35:23 PST ---
1. The static if in the function body is not required. You can return a void
expression from a void function.
2. Here is what still does not work:

class C{
void concatAssign(C other) { }
void concatAssign(short other) { }
void concatAssign(short[] other) { }

auto ref opOpAssign(string s, T)(T t) if (s == ~){
return concatAssign(t);
}
}

void main()
{
auto c = new C;
c.opOpAssign!~(c); // works
c.opOpAssign!~(1); // no go
c ~= 1;  // no go
c ~= [1,2,3];// no go

// (compare to)
short[] s;
s ~= 1;   // works
s ~= [1,2,3]; // works
}

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