[Issue 6430] New: Overloaded auto-return functions each with a nested aggregate of the same name are conflated
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Aug 2 13:34:54 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6430
Summary: Overloaded auto-return functions each with a nested
aggregate of the same name are conflated
Product: D
Version: D2
Platform: Other
OS/Version: Mac OS X
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: kennytm at gmail.com
--- Comment #0 from kennytm at gmail.com 2011-08-02 13:34:53 PDT ---
Test case 1:
-----------------------------
auto bug6430(int a) {
static struct Result2 {}
return 4;
}
auto bug6430(int a, int b) {
static struct Result2 {
int z;
int y() { return z; } // <-- line 11
}
auto t = Result2(1); // <-- line 13
return 5;
}
-----------------------------
x.d(11): Error: this for z needs to be type Result2 not type Result2
x.d(13): Error: more initializers than fields of Result2
-----------------------------
The same happens if we replace 'static struct' as 'class' or 'union' with or
without 'static'.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list