[Issue 2866] New: Can't declare static struct inside function scope
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Apr 20 19:27:39 PDT 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2866
Summary: Can't declare static struct inside function scope
Product: D
Version: 2.029
Platform: PC
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: dsimcha at yahoo.com
void foo() {
static struct Bar {
uint doStuff() {
return a;
}
}
}
D:\code\test.d(4): basic type expected, not struct
D:\code\test.d(4): no identifier for declarator int
D:\code\test.d(4): semicolon expected, not 'struct'
Before nested structs, one could declare a non-nested struct inside a function
scope by simply omitting the static keyword.
--
More information about the Digitalmars-d-bugs
mailing list