[Issue 5954] New: enum structs with ctor
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat May 7 16:35:14 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5954
Summary: enum structs with ctor
Product: D
Version: D2
Platform: Other
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2011-05-07 16:31:20 PDT ---
D2 code:
struct Foo {
int x;
this(int xx) {
this.x = xx;
}
}
void main() {
enum f = Foo(10);
}
DMD 2.053beta is not able to compile it, and shows the errors:
test.d(8): Error: variable __ctmp3 cannot be read at compile time
test.d(8): Error: cannot evaluate __ctmp3.this(10) at compile time
--
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