why implicitly allowing compare ubyte and byte sucks
Jarrett Billingsley
jarrett.billingsley at gmail.com
Thu Jun 11 13:17:32 PDT 2009
2009/6/11 Walter Bright <newshound1 at digitalmars.com>:
> davidl wrote:
>>
>> It seems that comparing two different operands with different size makes
>> no sense. The compiler should issue an error against that.
>
> Consider:
>
> byte b;
> if (b == 1)
>
> here you're comparing two different sizes, a byte and an int. Disallowing
> such (in its various incarnations) is a heavy burden, as the user will have
> to insert lots of ugly casts.
Weren't polysemous types supposed to avoid all that?
More information about the Digitalmars-d
mailing list