Bug 912 – forward referenced error in some cases (nested class)?

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-01-31T08:56:00Z
Last change time
2014-02-15T13:13:19Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
iceelyne

Comments

Comment #0 by iceelyne — 2007-01-31T08:56:20Z
forward referenced error in some cases (nested class)? for these 2 files: // testa.d: module testa; import testb; class A { B.C bc; void test(/+B.C bc+/) { B.C bc = null;//OK; } } // testb.d: module testb; import testa; class B { class C { void test(/+A a+/) { } } } try compile with dmd 1.0 dmd -c testb.d or dmd -c testb.d testa.d testb.d(4): class testb.B is forward referenced when looking for 'C' testb.d(4): class testb.B is forward referenced when looking for 'C' testa.d(5): Error: no property 'C' for type 'testb.B' testa.d(5): Error: B.C is used as a type testa.d(5): variable testa.A.bc voids have no value but with dmd -c testa.d testb.d no errors (and linked correctly later also). btw, dmd seems to be sensitive for files order, (e.g when building the DWT lib, some cases, build ok, but linker errors when use the lib file, just by some diff order the files was supplied (e.g build 2.08, 2.09, 2.10, 3.04, the compilation order is diff)) Should these be considered bugs. Not very sure, sorry.
Comment #1 by iceelyne — 2007-02-01T09:07:32Z
//test.d: class A { B.C bc; void test(/+B.C bc+/) { B.C bc = null;//OK; } } class B { class C { void test(/+A a+/) { } } } dmd -c test.d errors. //test.d: class B { class C { void test(/+A a+/) { } } } class A { B.C bc; void test(/+B.C bc+/) { B.C bc = null;//OK; } } dmd -c test.d OK.
Comment #2 by smjg — 2007-02-11T20:21:29Z
*** This bug has been marked as a duplicate of 102 ***