www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12461] New: Typedef and opOpAssign

https://d.puremagic.com/issues/show_bug.cgi?id=12461

           Summary: Typedef and opOpAssign
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: john.loughran.colvin gmail.com


--- Comment #0 from John Colvin <john.loughran.colvin gmail.com> 2014-03-25
12:45:13 GMT ---
Typedef really doesn't work.

import std.typecons;

alias Int = Typedef!(int);

unittest
{
    Int a, b;
    a += b;
}

typecons.d-mixin-3918(3918): Error: incompatible types for
(this.Typedef_payload) += (v)): 'int' and 'Typedef!(int, 0)'
/d32/f264.d(8): Error: template instance std.typecons.Typedef!(int,
0).Typedef.Proxy!(Typedef_payload).opOpAssign!("+", Typedef!(int, 0),
Typedef!(int, 0)) error instantiating
/d32/f264.d(8): Error: 'a += b' is not a scalar, it is a Typedef!(int, 0)
/d32/f264.d(8): Error: 'a' is not of arithmetic type, it is a Typedef!(int, 0)
/d32/f264.d(8): Error: 'b' is not of arithmetic type, it is a Typedef!(int, 0)

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