D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 12766 - Forward reference diagnostics must emit the offending line causing the forward reference
Summary: Forward reference diagnostics must emit the offending line causing the forwar...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 major
Assignee: No Owner
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2014-05-18 17:57 UTC by Andrej Mitrovic
Modified: 2022-08-22 15:48 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2014-05-18 17:57:29 UTC
-----
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.
Comment 1 RazvanN 2022-08-22 15:48:08 UTC
This now issues:

test.d(8): Error: struct `test.A` no size because of forward reference

So, I guess this has been fixed.