struct Foo { static assert(Foo.sizeof == 4); // ok pragma(msg, Foo.sizeof); // Error: struct test.Foo no size yet for forward reference int x; } void main() { } I'm not sure if it's genuinely a bug, IOW maybe the pragma is evaluated before the compiler does a pass to see which fields the struct is holding?
Workaround: Put the pragma call outside of the structure definition.
Fixed in 2.059, don't know by which commit though.