digitalmars.D.bugs - Forward reference wheel.
- Dawid =?UTF-8?B?Q2nEmcW8YXJraWV3aWN6?= (41/41) Mar 10 2006 It's probably well known issue:
- Chris Sauls (5/53) Mar 11 2006 E) I think. I believe you should be able to avoid this by changing `imp...
- Lars Ivar Igesund (3/59) Mar 11 2006 That won't help, he is forward referencing a type in the other module fr...
It's probably well known issue: $ cat test.d import test2; class X { Y.NY t; static class NX { } } $ cat test2.d import test; class Y { X.NX nx; static class NY { } } $ dmd -c test2.d test.d test2.d(3): class test2.Y is forward referenced when looking for 'NY' test2.d(3): class test2.Y is forward referenced when looking for 'NY' (...) dpc empire:~/stg/tmp$ dmd -c test.d test2.d test.d(3): class test.X is forward referenced when looking for 'NX' test.d(3): class test.X is forward referenced when looking for 'NX' (...) What I'd like to ask is: "How should I consider this?" to know what should do with this problem in my code. A) it's not a bug - it's just little limitation - things shall stay like this; B) it an issue, but it will not be fixed sooner than > 1.0; C) stay tuned, it surly be ready sooner than 1.0; D) it's fixed already - wait for 0.150 or maybe just little longer. E) you n00b! you can resolve this already without code modification by doing: (...); Thanks, Dawid
Mar 10 2006
Dawid Ciężarkiewicz wrote:It's probably well known issue: $ cat test.d import test2; class X { Y.NY t; static class NX { } } $ cat test2.d import test; class Y { X.NX nx; static class NY { } } $ dmd -c test2.d test.d test2.d(3): class test2.Y is forward referenced when looking for 'NY' test2.d(3): class test2.Y is forward referenced when looking for 'NY' (...) dpc empire:~/stg/tmp$ dmd -c test.d test2.d test.d(3): class test.X is forward referenced when looking for 'NX' test.d(3): class test.X is forward referenced when looking for 'NX' (...) What I'd like to ask is: "How should I consider this?" to know what should do with this problem in my code. A) it's not a bug - it's just little limitation - things shall stay like this; B) it an issue, but it will not be fixed sooner than > 1.0; C) stay tuned, it surly be ready sooner than 1.0; D) it's fixed already - wait for 0.150 or maybe just little longer. E) you n00b! you can resolve this already without code modification by doing: (...); Thanks, DawidE) I think. I believe you should be able to avoid this by changing `import test;` to `private import test;` and likewise for the `import test2;` in the other module. The private mode import will stop some cycles. -- Christopher Nicholson-Sauls
Mar 11 2006
Chris Sauls wrote:Dawid Ciężarkiewicz wrote:That won't help, he is forward referencing a type in the other module from both the modules.It's probably well known issue: $ cat test.d import test2; class X { Y.NY t; static class NX { } } $ cat test2.d import test; class Y { X.NX nx; static class NY { } } $ dmd -c test2.d test.d test2.d(3): class test2.Y is forward referenced when looking for 'NY' test2.d(3): class test2.Y is forward referenced when looking for 'NY' (...) dpc empire:~/stg/tmp$ dmd -c test.d test2.d test.d(3): class test.X is forward referenced when looking for 'NX' test.d(3): class test.X is forward referenced when looking for 'NX' (...) What I'd like to ask is: "How should I consider this?" to know what should do with this problem in my code. A) it's not a bug - it's just little limitation - things shall stay like this; B) it an issue, but it will not be fixed sooner than > 1.0; C) stay tuned, it surly be ready sooner than 1.0; D) it's fixed already - wait for 0.150 or maybe just little longer. E) you n00b! you can resolve this already without code modification by doing: (...); Thanks, DawidE) I think. I believe you should be able to avoid this by changing `import test;` to `private import test;` and likewise for the `import test2;` in the other module. The private mode import will stop some cycles. -- Christopher Nicholson-Sauls
Mar 11 2006