www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1538] New: "template instance forward reference to template declaration"

reply d-bugmail puremagic.com writes:

           Summary: "template instance forward reference to template
           Product: D
           Version: 1.021
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: webmaster villagersonline.com

Take these two files:
    import b;
    struct A(T) {}
    import a;
    struct B {};
    A!(B) foo;

Now b will compile, but a gets an error (in b):
  [russ russ template_forward_reference]$ dmd -c b.d
  [russ russ template_forward_reference]$ dmd -c a.d
  b.d(3): template instance forward reference to template declaration A(T)
  b.d(3): Error: A!(B ) is used as a type
  b.d(3): variable b.foo voids have no value
  [russ russ template_forward_reference]$

Sep 28 2007
parent d-bugmail puremagic.com writes:

smjg iname.com changed:

           What    |Removed                     |Added
                 CC|                            |smjg iname.com
             Status|NEW                         |RESOLVED
           Keywords|                            |rejects-valid
         Resolution|                            |DUPLICATE

------- Comment #1 from smjg iname.com  2007-10-29 08:06 -------

*** This bug has been marked as a duplicate of 1392 ***

Oct 29 2007