www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1564] New: Forward reference of enum

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1564

           Summary: Forward reference of enum
           Product: D
           Version: 1.022
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: binghe15 yeah.net


//file1 testA.d
module testa;
import testb;

enum TestEnum {
        A,
}

class CCC{
        int a;
}

struct SSS{
        int a;
}

------------------------------

//file2 testB.d
module testb;
import testa;

TestEnum te;
CCC ccc;
SSS sss;




Compile the testA.d, class and struct are ok, but to enum,dmd say "enum
TestEnum is forward referenced"

This question is divided into these kinds of situations specifically:
1.Compiling two files of above alone separately,DMD and GDC all fail when
compiling testA.d.
   dmd testA.d -c

2.DMD and GDC all fail to Compile two files of above in once,and testA.d in
before testB.d in back.
   dmd testA.d testB.d -c

3.DMD is OK GDC is fail when testB.d in before testA.d in back.
   dmd testB.d testA.d -c


-- 
Oct 09 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1564


smjg iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg iname.com
           Keywords|                            |rejects-valid
            Summary|Forward reference of enum   |Forward reference error for
                   |                            |enum in circular import





Not quite the error I get (DMD 1.022):

testA.d(5): Error: enum TestEnum is forward referenced

Please report compiler messages in full.  And please remember to assign
keywords to bug reports.  To everybody reading this: Please look through issues
you've reported and check for missing keywords.


-- 
Oct 10 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1564


matti.niemenmaa+dbugzilla iki.fi changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
OtherBugsDependingO|                            |340
              nThis|                            |





-------
Is this a duplicate of Issue 1160?


-- 
Oct 10 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1564






No.  Issue 1160 actually is a forward reference.  This isn't - the phrase
"forward referenced" just happens to be in the error message.


-- 
Nov 13 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1564


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



11:10:55 PST ---
Fixed dmd 1.054 and 2.038

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