[Issue 1392] Templates w/ forwd refs fail when in separate modules.

BCS ao at pathlink.com
Tue Jul 31 14:07:21 PDT 2007


Reply to d-bugmail at puremagic.com,

> http://d.puremagic.com/issues/show_bug.cgi?id=1392
> 
> ------- Comment #3 from cdunn2001 at gmail.com  2007-07-31 16:02 -------
> And since this fails:
> dmd -c fooFoo.d
> fooA.d(10): template instance forward reference to template
> declaration
> Foo(T)
> fooA.d(10): Error: Foo!(char) is used as a type
> (and note that the error is listed as being in the other module)
> it becomes impossible to write an implicit rule in a Makefile.
> 
> fooFoo.o: fooA.d fooFoo.d
> %.o: %.d
> dmd -c $^
> make fooFoo.o
> dmd -c fooFoo.d fooA.d
> fooA.d(10): template instance forward reference to template
> declaration
> Foo(T)
> fooA.d(10): Error: Foo!(char) is used as a type
> So I have to add a special rule in my Makefile:
> 
> fooFoo.o: fooA.d fooFoo.d
> ${DC} -c $^
> in order to get the files listed in the correct order.
> 

have you tried bud or rebuild?

http://www.dsource.org/projects/build/
http://www.dsource.org/projects/dsss/wiki/Rebuild




More information about the Digitalmars-d-bugs mailing list