byte & byte

Steven Schveighoffer schveiguy at yahoo.com
Wed Oct 27 21:02:41 PDT 2010


On Wed, 27 Oct 2010 23:34:04 -0400, Ellery Newcomer  
<ellery-newcomer at utulsa.edu> wrote:

> Hm. Thanks for the heads up.
>
> Now how about
>
> byte &= int
>
> is there any good reason why the result type of that isn't error?

Well, if 'int' represents a literal, or a manifest constant, they are not  
exactly ints.  When the compiler can tell that the result of the operation  
will fit into a byte, it allows it to go through.  I believe when it can't  
tell, it should error, but &= may be a special case, I'm not sure.

-Steve


More information about the Digitalmars-d-learn mailing list