https://issues.dlang.org/show_bug.cgi?id=17194
Issue ID: 17194
Summary: [scope] Fwd reference error with nested struct
Product: D
Version: D2
Hardware: x86_64
OS: Windows
Status: NEW
Severity: major
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
The following:
struct V
{
W w;
struct W
{
this(scope ref V v)
{
this.v = &v;
}
V* v;
}
}
void main()
{
V v;
}
Produces this:
Error: struct app.V no size because of forward reference
Expecting: to compile.
Error is also not pointing the line number the issue was suppose to be.
Work around:
1. Removing the "scope" keyword makes the program compile.
2. Changing W ctor signature to:
this(scope V* v)
{
this.v = v;
}
also makes it work.
Compiled with dmd 2.073.1 on win32
--