Untyped string variable fails silently. No compiler warning given.

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu Mar 13 07:07:40 PDT 2014


On 3/13/14, Gary Willoughby <dev at nomad.so> wrote:
> Rather nasty bug that silently fails. Linux DMD64 D Compiler
> v2.065

Unfortunately it's not a variable, it's the std.conv.text function
being called. I've actually ran into this nasty "bug" once already.

It all boils down to being allowed to call functions via "foo = bar;"

-----
void text(string x) { }

void main()
{
    text = "";
}
-----

However I think this will be finally fixed once property enforcement
is properly implemented.


More information about the Digitalmars-d mailing list