D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7852 - "Error: forward reference" depending on order of source files
Summary: "Error: forward reference" depending on order of source files
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-07 15:38 UTC by Nils
Modified: 2013-11-24 04:18 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Nils 2012-04-07 15:38:39 UTC
$ cat a.d
import b;
void fa() {
        fb!int();
}

$ cat b.d
struct S(T) {
        void fs() {
                fb!int();
        }
}
S!T fb(T)() {
        return S!T();
}

$ dmd -c -o- a b

$ dmd -c -o- b a
b.d(3): Error: forward reference to fb
b.d(6): Error: template instance b.S!(int) error instantiating
a.d(3):        instantiated from here: fb!(int)
a.d(3): Error: template instance b.fb!(int) error instantiating
Comment 1 SomeDude 2012-04-21 11:37:38 UTC
See also issue 7904
Comment 2 Kenji Hara 2013-11-24 04:18:46 UTC
Seems fixed in 2.064.