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

Jonathan M Davis jmdavisProg at gmx.com
Wed Dec 12 19:22:07 PST 2012


On Wednesday, December 12, 2012 13:35:59 Walter Bright wrote:
> On 12/12/2012 10:25 AM, Jonathan M Davis wrote:
> > If alias this isn't do an implict conversion, then there's a bug in alias
> > this. That's how implict conversion is done in D, and it's the whole point
> > of alias this.
> 
> And it does, as I relied on this to do the halffloat implementation.

Simen's example doesn't seem to work though, so he appears to have found a 
bug. Certainly, I don't see anything wrong with it, but alias this doesn't 
seem to work for it. Regardless, my point was that if there's a case where 
alias this isn't doing an implicit conversion, then it's a bug, because that's 
the whole reason that it exists.

- Jonathan M Davis


More information about the Digitalmars-d mailing list