[Issue 9181] New: Forward reference error in struct static fields
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Dec 18 18:36:05 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9181
Summary: Forward reference error in struct static fields
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2012-12-18 18:36:00 PST ---
This program compiles with no errors:
struct Foo {
static immutable F = Foo();
static immutable Foo[] foos1 = [F];
}
void main() {}
If I remove the type of foos1 it doesn't compile:
struct Foo {
static immutable F = Foo();
static immutable foos1 = [F];
}
void main() {}
DMD 2.061alpha gives:
test.d(3): Error: forward reference of variable F
--
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