Bug 1564 – Forward reference error for enum in circular import

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-10-09T23:33:00Z
Last change time
2014-02-24T15:33:34Z
Keywords
rejects-valid
Assigned to
nobody
Creator
binghe15
Blocks
340

Comments

Comment #0 by binghe15 — 2007-10-09T23:33:28Z
//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
Comment #1 by smjg — 2007-10-10T07:51:58Z
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.
Comment #2 by matti.niemenmaa+dbugzilla — 2007-10-10T11:15:42Z
Is this a duplicate of Issue 1160?
Comment #3 by smjg — 2007-11-13T17:13:39Z
No. Issue 1160 actually is a forward reference. This isn't - the phrase "forward referenced" just happens to be in the error message.
Comment #4 by bugzilla — 2009-12-31T11:10:55Z
Fixed dmd 1.054 and 2.038