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.
This appears to have been fixed at some point in the past.