[Issue 1392] Template instantiation fails with circular import

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 21 09:30:49 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1392


smjg at iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg at iname.com
           Keywords|                            |rejects-valid
            Summary|Templates w/ forwd refs fail|Template instantiation fails
                   |when in separate modules.   |with circular import




------- Comment #6 from smjg at iname.com  2007-10-21 11:30 -------
Minimal testcase:

----- bz1392a.d -----
import bz1392b;

Foo!(char)* x;
----- bz1392b.d -----
import bz1392a;

class Foo(T) {}
----------

Success:
dmd bz1392a.d
dmd bz1392a.d bz1392b.d

Failure:
dmd bz1392b.d
dmd bz1392b.d bz1392a.d

bz1392a.d(3): template instance forward reference to template declaration
Foo(T)
bz1392a.d(3): Error: Foo!(char) is used as a type


-- 



More information about the Digitalmars-d-bugs mailing list