Deprecate implicit conversion between signed and unsigned integers

Paul Backus snarwin at gmail.com
Mon Feb 17 15:07:48 UTC 2025


On Monday, 17 February 2025 at 09:01:45 UTC, Walter Bright wrote:
> On 2/13/2025 4:00 PM, Quirin Schroll wrote:
>> If D made any of them UB, it would exclude part of basic 
>> arithmetic from `@safe` because `@safe` bans every operation 
>> that *can* introduce UB.
>
> @safe only bans memory corruption. 2's complement arithmetic is 
> not UB.

Dividing an integer by zero is UB according to the D spec [1], 
and it is allowed in @safe code.

[1] https://dlang.org/spec/expression.html#division


More information about the dip.ideas mailing list