Bug 3486 – [tdpl] Incorrect result type of binary operators applied to typedef'd types

Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2009-11-07T10:11:00Z
Last change time
2015-06-09T05:14:39Z
Assigned to
nobody
Creator
andrei

Comments

Comment #0 by andrei — 2009-11-07T10:11:09Z
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.
Comment #1 by bugzilla — 2009-11-18T10:54:09Z
Dropping typedef, so won't fix.