Should you be able to initialize a float with a char?

forkit forkit at gmail.com
Fri May 20 02:09:43 UTC 2022


On Wednesday, 18 May 2022 at 22:24:18 UTC, Paul Backus wrote:
>
>
> So I would say that according to the spec, the answer is "yes, 
> the example should work." Though it is rather surprising.
>

It's actually rather *unsurprising* (given D's compatability 
needs with C).

What is surprising, is that there's no compiler option to disable 
implicit type casts, or to disable them in @safe, or *at the very 
least*, output a record of such casts for auditing (to help 
minimise bugs and vulnerabilities).



More information about the Digitalmars-d mailing list