Deprecate implicit conversion between signed and unsigned integers

Paul Backus snarwin at gmail.com
Tue May 14 13:37:01 UTC 2024


On Tuesday, 14 May 2024 at 06:59:16 UTC, Dom DiSc wrote:
> On Sunday, 12 May 2024 at 20:20:10 UTC, Nick Treleaven wrote:
>> What about comparisons between incompatible signed and 
>> unsigned, deprecate too?
>
> We have a working solution that always returns the correct 
> result (see https://issues.dlang.org/show_bug.cgi?id=259). I 
> never understood why anyone would rely on a wrong comparison 
> result, so this should not be considered a breaking change.

As I said in my reply to Nick, this proposal makes no distinction 
between conversions done in the context of a comparison and 
conversions done in any other context.

I would rather not introduce a special case for comparisons, 
since special cases generally make the language more complex and 
harder to use. However, if you think this is a good idea, I 
encourage you to submit it as a separate proposal.


More information about the dip.ideas mailing list