D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 16607 - [REG2.072b1] forward reference error for nested struct
Summary: [REG2.072b1] forward reference error for nested struct
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2016-10-11 08:05 UTC by Vladimir Panteleev
Modified: 2018-12-21 05:29 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Vladimir Panteleev 2016-10-11 08:05:19 UTC
//////// test.d ////////
struct A(T)
{
    T t;

    struct C
    {
    }
}

struct B
{
    A!(typeof(this))* a;
}
////////////////////////

Compiler output:

test.d(5): Error: struct test.A!(B).A.C has forward references
test.d(12): Error: template instance test.A!(B) error instantiating

Introduced in https://github.com/D-Programming-Language/dmd/pull/5500
Comment 1 Martin Nowak 2016-10-19 23:27:08 UTC
Also caused by the 2nd commit of that PR https://github.com/dlang/dmd/pull/5500/commits/75b5b691555bef2d2f21b44821f297f93ddfbc77.
Comment 2 Martin Nowak 2016-10-25 11:40:46 UTC
https://github.com/dlang/dmd/pull/6214
Comment 3 github-bugzilla 2016-10-27 10:20:26 UTC
Commits pushed to stable at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/b295ff509a52cd332d975014279ed891e11f465d
fix Issue 16607 - forward reference error for nested struct

- This reverts removing the AggregateDeclaration.setScope override (see
  75b5b69155) and fixes a wrong error triggered by setting _scope on a
  SIZEOKdone struct during deferred setScope phases (outer struct has
  forward references).

https://github.com/dlang/dmd/commit/9dfa50e8fccd9b888a52300abb99eb3d669fb869
Merge pull request #6214 from MartinNowak/fix16607

fix Issue 16607 - forward reference error for nested struct
Comment 4 github-bugzilla 2016-11-05 03:41:38 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/b295ff509a52cd332d975014279ed891e11f465d
fix Issue 16607 - forward reference error for nested struct

https://github.com/dlang/dmd/commit/9dfa50e8fccd9b888a52300abb99eb3d669fb869
Merge pull request #6214 from MartinNowak/fix16607
Comment 5 github-bugzilla 2016-12-27 14:40:48 UTC
Commits pushed to scope at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/b295ff509a52cd332d975014279ed891e11f465d
fix Issue 16607 - forward reference error for nested struct

https://github.com/dlang/dmd/commit/9dfa50e8fccd9b888a52300abb99eb3d669fb869
Merge pull request #6214 from MartinNowak/fix16607
Comment 6 github-bugzilla 2017-01-16 23:24:03 UTC
Commits pushed to newCTFE at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/b295ff509a52cd332d975014279ed891e11f465d
fix Issue 16607 - forward reference error for nested struct

https://github.com/dlang/dmd/commit/9dfa50e8fccd9b888a52300abb99eb3d669fb869
Merge pull request #6214 from MartinNowak/fix16607