dmd 1.046 and 2.031 releases

Steven Schveighoffer schveiguy at yahoo.com
Fri Jul 17 06:31:41 PDT 2009


On Fri, 17 Jul 2009 08:08:23 -0400, Don <nospam at nospam.com> wrote:

> In this case, I think bearophile's right: it's just a problem with range  
> propagation of the ?: operator. I think the compiler should be required  
> to do the semantics analysis for single expressions. Not more, not less.

Why?  What is the benefit of keeping track of the range of integral  
variables inside an expression, to eliminate a cast?  I don't think it's  
worth it.  As far as I know, the ?: is the only expression where this can  
happen.  You will get cries of inconsistency when the compiler doesn't  
allow:

ubyte foo(uint x)
{
   if(x < 256)
      return x;
   return 0;
}

-Steve


More information about the Digitalmars-d-announce mailing list