compile with "dmd M N" === M.d === Start module M; import N; abstract class Format{ static class Field {} abstract void doit( FieldPosition p ); } void main(){} === M.d === End === N.d === Start module N; import M; class FieldPosition { static class F2 : M.Format.Field { } this( M.Format.Field f){ } } === N.d === End Messages: M.d(3): Error: class M.Format is forward referenced when looking for 'Field' M.d(3): Error: class M.Format is forward referenced when looking for 'Field' M.d(3): Error: class M.Format is forward referenced when looking for 'Field' N.d(6): Error: no property 'Field' for type 'M.Format' N.d(6): Error: M.Format.Field is used as a type N.d(6): Error: class N.FieldPosition.F2 base type must be class or interface, not void M.d(3): Error: class M.Format is forward referenced when looking for 'Field' M.d(3): Error: class M.Format is forward referenced when looking for 'Field' M.d(3): Error: class M.Format is forward referenced when looking for 'Field' N.d(8): Error: no property 'Field' for type 'M.Format' N.d(8): Error: M.Format.Field is used as a type N.d(8): Error: cannot have parameter of type void
This could be related to bug 102. Except that this one compiles without error if N is given on the command line first.
I could not reproduce this bug with DMD 1.047 and DMD 2.032.
(In reply to comment #2) > I could not reproduce this bug with DMD 1.047 and DMD 2.032. I do not get any errors from file M, only from file N. Even when using DMD1.041, or 1.010 -- so I can't reproduce the original bug. It still fails to compile, however -- all the file N errors are still present in 1.047 and 2.032.
Hmmm, strange. I double-checked: no errors for 1.047 and 2.032, but the same errors as in the original report for 1.046 and 2.031. I've just copied the code from the report. Have you made any modification? The source changes for 2.031 and 2.032 also deal with this problem, see "mustsemantic" in class.c (though I could not see in the debugger, that the changes in 2.032 kick in...)
You are quite right. I was using different filenames, and stuffed up the translation -- I still had M.Format.Field. Yes, this is fixed in 1.047.