DMD can implicitly convert class pointer to the bool. Is it bug or terrible feature?

ilya-stromberg ilya-stromberg-2009 at yandex.ru
Tue Nov 26 01:03:11 PST 2013


On Tuesday, 26 November 2013 at 08:33:58 UTC, Chris Cain wrote:
> On Tuesday, 26 November 2013 at 08:23:15 UTC, bearophile wrote:
>> That is named "relying on hand-managed name conventions for 
>> something that could be the job of the compiler type system".
>
> Sure. It'd have been nice if the language was designed to avoid 
> these types of problems from the beginning (though a language 
> feature/syntax rules to learn dedicated to a problem that is 
> easily solved with a naming convention would be debatable). But 
> it wasn't and it'd break too much code for a minuscule gain and 
> there exists a reasonable workaround (that also is commonly 
> used everywhere else for this same problem in most other 
> languages). Changing this now would be horrifically bad and the 
> benefit of such a change is effectively nothing.

Yes, but D/Phobos depreciates/removes a lot of different things.
For example, we can use only warning (maybe only with special
compiler flag like `-property`).


More information about the Digitalmars-d mailing list