digitalmars.D.bugs - struct forward reference
- Chris Miller (4/4) Feb 07 2006 struct Foo { const Foo f; }
- Fredrik Olsson (4/13) Feb 08 2006 Would not this be recursive to infinity? Perhaps this is more in line
- Chris Miller (4/12) Feb 08 2006 Don't think so, not like it's actually adding to the struct's storage.
- Stewart Gordon (12/19) Feb 08 2006 Sounds like a regression to me. So what happens if it isn't const? It
- Jarrett Billingsley (13/15) Feb 08 2006 It still fails if the member is non-const.
- Thomas Kuehne (17/21) Feb 11 2006 -----BEGIN PGP SIGNED MESSAGE-----
struct Foo { const Foo f; } DMD 0.145 output on Windows: test.d(1): struct test.Foo unable to resolve forward reference Only seems to happen if it's const.
Feb 07 2006
Chris Miller skrev:struct Foo { const Foo f; } DMD 0.145 output on Windows: test.d(1): struct test.Foo unable to resolve forward reference Only seems to happen if it's const.Would not this be recursive to infinity? Perhaps this is more in line what you want: struct Foo { const Foo* f; }
Feb 08 2006
On Wed, 08 Feb 2006 03:20:10 -0500, Fredrik Olsson <peylow treyst.se> wrote:Chris Miller skrev:Don't think so, not like it's actually adding to the struct's storage. More like a namespace thing or implying static as well.struct Foo { const Foo f; } DMD 0.145 output on Windows: test.d(1): struct test.Foo unable to resolve forward reference Only seems to happen if it's const.Would not this be recursive to infinity? Perhaps this is more in line what you want: struct Foo { const Foo* f; }
Feb 08 2006
Chris Miller wrote:struct Foo { const Foo f; } DMD 0.145 output on Windows: test.d(1): struct test.Foo unable to resolve forward reference Only seems to happen if it's const.Sounds like a regression to me. So what happens if it isn't const? It should be an error regardless. Will have to investigate.... Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- C++ a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Feb 08 2006
"Stewart Gordon" <smjg_1998 yahoo.com> wrote in message news:dsclko$1c26$1 digitaldaemon.com...Sounds like a regression to me. So what happens if it isn't const? It should be an error regardless.It still fails if the member is non-const. Though, like Fredrik said, I would imagine that, since structs are value types, this should be illegal, because it would have to be a recursive structure - a Foo contains a Foo, which contains a Foo which contains a Foo.. perhaps this error message is the compiler's own special way of reporting this ;) as struct Foo { [const] Foo* a; } Works.
Feb 08 2006
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Chris Miller schrieb am 2006-02-07:struct Foo { const Foo f; } DMD 0.145 output on Windows: test.d(1): struct test.Foo unable to resolve forward reference Only seems to happen if it's const.Added to DStress as http://dstress.kuehne.cn/nocompile/s/struct_23_A.d http://dstress.kuehne.cn/nocompile/s/struct_23_B.d http://dstress.kuehne.cn/nocompile/s/struct_23_C.d http://dstress.kuehne.cn/nocompile/s/struct_23_D.d http://dstress.kuehne.cn/nocompile/s/struct_23_E.d http://dstress.kuehne.cn/run/s/struct_23_F.d http://dstress.kuehne.cn/run/s/struct_23_G.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFD7bkU3w+/yD4P9tIRAlAxAJ9s9tRf4XLqxFuSgZUpgGEielpJ8QCgw3+2 Q3iUGr0cAA5whMQEFNQLUHk= =xyBR -----END PGP SIGNATURE-----
Feb 11 2006