Deprecate implicit conversion between signed and unsigned integers

Quirin Schroll qs.il.paperinik at gmail.com
Tue Feb 4 16:29:22 UTC 2025


On Monday, 3 February 2025 at 18:40:20 UTC, Atila Neves wrote:
> https://forum.dlang.org/post/pbhjffbxdqpdwtmcbikh@forum.dlang.org
>
> On Sunday, 12 May 2024 at 13:32:36 UTC, Paul Backus wrote:
>> D inherited these implicit conversions from C and C++, where 
>> they are widely regarded as a source of bugs.
>>
>> [...]
>
> My bias is to not like any implicit conversions of any kind, 
> but I'm not sure I can convince Walter of that.

Any implicit conversions? I’d boldly claim the following 
conversions are unproblematic:
* `float` → `double` → `real`
* signed integer → bigger signed integer
* unsigned integer → bigger unsigned integer

And it would be really annoying to have to explicitly cast them.


More information about the dip.ideas mailing list