//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.