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

kenji hara k.hara.pg at gmail.com
Thu Dec 13 04:51:41 PST 2012


D does not support such implicit *construction* in return statement and
function argument.
It is a current language design, and not a bug.

Kenji Hara


2012/12/13 Simen Kjaeraas <simen.kjaras at gmail.com>

> On 2012-22-13 04:12, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
>
>  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.
>>
>
> So it is supposed to work? I've always thought this was a deliberate design
> choice. I guess I'll file a bug, then. Here:
>
> http://d.puremagic.com/issues/**show_bug.cgi?id=9147<http://d.puremagic.com/issues/show_bug.cgi?id=9147>
>
> Kenji, you here? :p
>
> --
> Simen
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121213/1c813546/attachment.html>


More information about the Digitalmars-d mailing list