digitalmars.D.bugs - [Bug 159] New: forward reverence with invalid struct
- d-bugmail puremagic.com (20/20) May 27 2006 http://d.puremagic.com/bugzilla/show_bug.cgi?id=159
- d-bugmail puremagic.com (7/7) Jun 01 2006 http://d.puremagic.com/bugzilla/show_bug.cgi?id=159
- d-bugmail puremagic.com (5/5) Jun 01 2006 http://d.puremagic.com/bugzilla/show_bug.cgi?id=159
- Kyle Furlong (5/16) Jun 01 2006 Maybe a more helpful diagnostic then?
- d-bugmail puremagic.com (17/17) Jun 02 2006 http://d.puremagic.com/bugzilla/show_bug.cgi?id=159
http://d.puremagic.com/bugzilla/show_bug.cgi?id=159 Summary: forward reverence with invalid struct Product: D Version: 0.159 Platform: PC OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: benoit tionex.de 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 --
May 27 2006
http://d.puremagic.com/bugzilla/show_bug.cgi?id=159 bugzilla digitalmars.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |INVALID --
Jun 01 2006
http://d.puremagic.com/bugzilla/show_bug.cgi?id=159 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. --
Jun 01 2006
d-bugmail puremagic.com wrote:http://d.puremagic.com/bugzilla/show_bug.cgi?id=159 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.Maybe a more helpful diagnostic then? -- Kyle Furlong // Physics Undergrad, UCSB "D is going wherever the D community wants it to go." - Walter Bright
Jun 01 2006
http://d.puremagic.com/bugzilla/show_bug.cgi?id=159 smjg iname.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|INVALID | 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 --
Jun 02 2006