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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 31 14:02:37 PDT 2007


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.


-- 



More information about the Digitalmars-d-bugs mailing list