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:
http://d.puremagic.com/issues/show_bug.cgi?id=1538

           Summary: "template instance forward reference to template
                    declaration"
           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:
  a.d:
    import b;
    struct A(T) {}
  b.d:
    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:
http://d.puremagic.com/issues/show_bug.cgi?id=1538


smjg iname.com changed:

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







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


-- 
Oct 29 2007