What is the reasoning behind the lack of conversions when passing parameters

Walter Bright newshound2 at digitalmars.com
Sun Feb 11 19:26:39 UTC 2024


We've considered it many times, and have decided against it due to the 
consistently negative experience with it in C++. Despite it being opt-in, it 
gets routinely abused.

Overloading, even with all its restrictions in D, still gets abused to create 
incomprehensible code. When debugging Phobos code, often the only way I can 
figure out which overload is used is to insert `pragma(msg)` statements.

Sumtypes and pattern matching are important issues, and I'll talk about that at 
the upcoming DConf online.


More information about the Digitalmars-d mailing list