[Issue 2878] New: Forward reference

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 22 06:38:21 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2878

           Summary: Forward reference
           Product: D
           Version: 1.042
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: benoit at tionex.de


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


-- 



More information about the Digitalmars-d-bugs mailing list