wrong code: code with undeclared variables compiles (cf b/14813)

Timothee Cour via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 20 00:00:55 PDT 2015


reposting https://issues.dlang.org/show_bug.cgi?id=14813 here as it seems
quite weird:

/+
dmd -c -o- main.d
how come this even compiles?
+/

main.d:
-----------
void fun()
{
    alias A = void delegate(int);
    //WTF?
    A temp1 = (some_inexistant_field) {  };
    //WTF?
    A temp2 = delegate(some_inexistant_field) {  };

    alias A2 = void delegate(int,double);
    //WTF?
    A2 temp3 = (some_inexistant_field,sadfasfd) {  };
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150720/4b7b4d55/attachment.html>


More information about the Digitalmars-d mailing list