http://d.puremagic.com/issues/show_bug.cgi?id=3486
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
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Andrei Alexandrescu <[email protected]> 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: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------