This compiled with dmd 0.157. Well i think its not legal code ...
public struct S; // this should be an error, i think
public struct S1 { // error is show here
S s;
}
Error:
mod.d(7): struct mod.S1 unable to resolve forward reference
Comment #1 by bugzilla — 2006-06-01T14:25:50Z
It's ok to declare a struct without { }. However, this won't work if the size of S is needed, as it is in S1. Hence, the error diagnostic.
Comment #2 by smjg — 2006-06-02T09:02:45Z
Since when has "forward reference" meant this? In my vocabulary, a forward reference is when you refer to something before it's declared. Which isn't happening here. A forward _declaration_, OTOH, is when you declare something and then define it later. This would be a forward declaration except that in this example, S is never defined.
As such, what we have isn't a forward anything. So of course it's a badly written error message.
A better error would be:
mod.d(7): unable to resolve declaration of type S - size is unknown