www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12766] New: Forward reference diagnostics must emit the

https://issues.dlang.org/show_bug.cgi?id=12766

          Issue ID: 12766
           Summary: Forward reference diagnostics must emit the offending
                    line causing the forward reference
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: diagnostic
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: andrej.mitrovich gmail.com

-----
struct A
{
    B b;  // L3
}

struct B // L6
{
    A a;  // L8
}

void main() { }
-----

$ test.d(6): Error: struct test.B no size yet for forward reference

This is a completely useless diagnostic, it doesn't tell me *what code* caused
the forward reference. It should either reference L3 or L8, not the line of the
beginning of the struct definition.

--
May 18 2014