www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2878] New: Forward reference

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: benoit 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


-- 
Apr 22 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2878


smjg iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg iname.com
OtherBugsDependingO|                            |340
              nThis|                            |
           Keywords|                            |rejects-valid
            Summary|Forward reference           |Forward reference error with
                   |                            |circular import and nested
                   |                            |classes




------- Comment #1 from smjg iname.com  2009-04-22 20:17 -------
This could be related to bug 102.  Except that this one compiles without error
if N is given on the command line first.


-- 
Apr 22 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2878


Rainer Schuetze <r.sagitario gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.sagitario gmx.de


--- Comment #2 from Rainer Schuetze <r.sagitario gmx.de> 2009-09-18 01:54:02
PDT ---
I could not reproduce this bug with DMD 1.047 and DMD 2.032.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 18 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2878


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au


--- Comment #3 from Don <clugdbug yahoo.com.au> 2009-09-18 15:22:42 PDT ---
(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. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 18 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2878



--- Comment #4 from Rainer Schuetze <r.sagitario gmx.de> 2009-09-19 01:01:46
PDT ---
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...)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 19 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2878


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #5 from Don <clugdbug yahoo.com.au> 2009-09-19 11:38:05 PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 19 2009