Bug in D?!
ketmar via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Aug 11 15:50:53 PDT 2017
Mr. Pib wrote:
> Wow, that is pretty screwed up! I thought D was against implicit
> conversions that might cause problems? I'm passing an int and I should
> be able to append an int without having to worry about the value of the
> int. Instead D chose to do something very strange, awkward, and error
> prone.
this is legacy we got from trying to be C-compatible (along with int/uint
autoconversion, and some other things). i believe that initially it was
done to allow something like `char c = 32;`, and now it is too late to
change it, 'cause such change will break existing code (and we're trying to
not break the code without a *very* strong reason, even if keeping old code
working means keeping some old quirks).
More information about the Digitalmars-d-learn
mailing list