Bug 7852 – "Error: forward reference" depending on order of source files

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-07T15:38:00Z
Last change time
2013-11-24T04:18:46Z
Assigned to
nobody
Creator
nilsbossung

Comments

Comment #0 by nilsbossung — 2012-04-07T15:38:39Z
$ 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 by lovelydear — 2012-04-21T11:37:38Z
See also issue 7904
Comment #2 by k.hara.pg — 2013-11-24T04:18:46Z
Seems fixed in 2.064.