Summary: [tdpl] Incorrect result type of binary operators
                    applied to typedef'd types
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Andrei Alexandrescu <> 2009-11-07 
10:11:09 PST ---
unittest {
    Mass m;
    Velocity v;
    pragma(msg, typeof(m * v).stringof);
    pragma(msg, typeof(v * m).stringof);
    static assert(is(typeof(m * v) == double));
    static assert(is(typeof(v * m) == double));

Currently the type of m * v is Velocity, and the type of v * m is Mass. The
only reasonable type of an operation (if it compiles at all) should be double,
obtained after both operands are converted to their supertype.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to