Is there any reason why arithmetic operation on shorts and bytes return int?

d coder dlang.coder at gmail.com
Tue Dec 11 08:36:42 PST 2012


Thanks Everybody for responding. I have another query which is off-topic
but related.

Why is the following allowed in D?

long a;
int b;

b += a; // Allowed -- no explicit cast
b = a + b; // Not allowed
b = a;      // Not allowed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121211/5f8a984c/attachment.html>


More information about the Digitalmars-d mailing list