Thread overview | |||||
---|---|---|---|---|---|
|
January 12, 2005 Forward declarations under certain situations? | ||||
---|---|---|---|---|
| ||||
Apologies if this has already been asked, code: class A{ B b; enum B { x,y,z } } Produces this error: enum B is forward referenced It was my understanding that D did not require forward declarations, the existance of this error message implies that this is an error by design. Am I missing something? |
January 12, 2005 Re: Forward declarations under certain situations? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Geordi | Geordi wrote: > Apologies if this has already been asked, See my post today on digitalmars.D.bugs. <snip> > Produces this error: > enum B is forward referenced > > It was my understanding that D did not require forward declarations, the > existance of this error message implies that this is an error by design. Am I > missing something? This aspect of the language is slowly working its way in. Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit. |
January 12, 2005 Re: Forward declarations under certain situations? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Geordi | "Geordi" <Geordi_member@pathlink.com> wrote in message news:cs37sk$1lll$1@digitaldaemon.com... > Apologies if this has already been asked, > > code: > > class A{ > B b; > enum B { x,y,z } > } > > Produces this error: > enum B is forward referenced > > It was my understanding that D did not require forward declarations, the existance of this error message implies that this is an error by design. Am I > missing something? No, you're not missing anything. Enums just haven't gotten the attention they need in the internal compiler workings to support forward referencing yet. The last compiler update went through some significant internal work to get structs to forward reference right. It'll happen for enums, too, it's just a lower priority. |
Copyright © 1999-2021 by the D Language Foundation