Why there is too many uneccessary casts?
    Adam D. Ruppe 
    destructionator at gmail.com
       
    Tue Jun 11 12:20:42 PDT 2013
    
    
  
On Tuesday, 11 June 2013 at 19:09:11 UTC, Timothee Cour wrote:
> wouldn't it be a better and more consistent idea to implement 
> bearophile's 'Compiler support to implement efficient safe 
> integrals'
> http://d.puremagic.com/issues/show_bug.cgi?id=9850 so uint/int 
> etc would require no cast
This isn't really about overflow though, it is about cutting off 
bits on assignment.
int a = 0;
byte b = a;
test11.d(3): Error: cannot implicitly convert expression (a) of 
type int to byte
The only reason this comes up in the OP's case is because of the 
int promotion for arithmetic.
    
    
More information about the Digitalmars-d-learn
mailing list