dmd 1.046 and 2.031 releases

Walter Bright newshound1 at digitalmars.com
Tue Jul 7 18:05:45 PDT 2009


Andrei Alexandrescu wrote:
> Robert Jacques wrote:
>>>> long g;
>>>> g = e + f;  => d = cast(long) e + cast(long) f;
>>>
>>> Works today.
>>
>> Wrong. I just tested this and what happens today is:
>> g = cast(long)(e+f);
>> And this is (I think) correct behavior according to the new rules and 
>> not a bug. In the new rules int is special, in this suggestion, it's not.
> 
> I think this is a good idea that would improve things. I think, however, 
> it would be troublesome to implement because expressions are typed 
> bottom-up. The need here is to "teleport" type information from the 
> assignment node to the addition node, which is downwards. And I'm not 
> sure how this would generalize to other operators beyond "=".

It's also troublesome because it would silently produce different 
answers than C would.


More information about the Digitalmars-d-announce mailing list