D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 14813 - wrong code: code with undeclared variables compiles
Summary: wrong code: code with undeclared variables compiles
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Mac OS X
: P1 blocker
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-20 06:58 UTC by Timothee Cour
Modified: 2015-07-20 07:53 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Timothee Cour 2015-07-20 06:58:45 UTC
/+
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) {  };
}
Comment 1 Timothee Cour 2015-07-20 07:53:18 UTC
It's valid code. not sure what i was thinking... happens when you post late