Thread overview
[Issue 16627] [Reg 2.072] struct with disabled postblit field is now nested
Oct 19, 2016
Martin Nowak
Oct 24, 2016
Martin Nowak
[Issue 16627] [Reg 2.072] non-static structs with postblit/dtor fields are now nested
Oct 24, 2016
Martin Nowak
Dec 21, 2018
Walter Bright
October 19, 2016
https://issues.dlang.org/show_bug.cgi?id=16627

--- Comment #1 from Martin Nowak <code@dawg.eu> ---
Caused by the 2nd commit of that PR https://github.com/dlang/dmd/pull/5500/commits/75b5b691555bef2d2f21b44821f297f93ddfbc77.

--
October 24, 2016
https://issues.dlang.org/show_bug.cgi?id=16627

--- Comment #2 from Martin Nowak <code@dawg.eu> ---
This happens because structs are converted to nested structs by the semantic
analysis of their member functions.
The idea behind this seems to be that struct without methods can't access the
outer frame, hence never need nesting. Could be reconsidered to be deprecated
in favor of explicit `static struct` or a proper detection of closure access.

With dlang/dmd#5500 the dependency of the generate postblits/dtors on a finalized struct size was removed, now semantic just collects a list of fields and finalizes the size later on. This resolves some problems w/ forward references.

Previously __fieldPostblit and __fieldDtor were generated after finalizing the size and didn't convert structs to a nested one due to a `if (sizeok == SIZEOKdone) return;` check in makeNested. Now semantic for those functions runs before the finalization and does convert structs to nested.

This bug only affects structs w/o any other function (b/c those would be nested already) and at least one field w/ dtor/postblit.

--
October 24, 2016
https://issues.dlang.org/show_bug.cgi?id=16627

Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[Reg 2.072] struct with     |[Reg 2.072] non-static
                   |disabled postblit field is  |structs with postblit/dtor
                   |now nested                  |fields are now nested

--
October 25, 2016
https://issues.dlang.org/show_bug.cgi?id=16627

--- Comment #3 from github-bugzilla@puremagic.com ---
Commits pushed to stable at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/868ce84e30a3d4e1157e9e72bc3e308b0cd0b1db fix Issue 16627 - non-static structs with postblit/dtor fields now nested

- Since dlang/dmd#5500 buildPostblit/Dtor/OpAssign are run before
  the struct size is finalized, thereby now making structs nested
  that previously were not.
- Not sure if the old behavior was an intended feature. If not
  we might want to deprecate it.

https://github.com/dlang/dmd/commit/8e8541a941bb8fdacf6c8b7a042a69cf77d4676c Merge pull request #6212 from MartinNowak/fix16627

fix Issue 16627 - non-static structs with postblit/dtor fields now nested

--
October 25, 2016
https://issues.dlang.org/show_bug.cgi?id=16627

github-bugzilla@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
November 05, 2016
https://issues.dlang.org/show_bug.cgi?id=16627

--- Comment #4 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/868ce84e30a3d4e1157e9e72bc3e308b0cd0b1db fix Issue 16627 - non-static structs with postblit/dtor fields now nested

https://github.com/dlang/dmd/commit/8e8541a941bb8fdacf6c8b7a042a69cf77d4676c Merge pull request #6212 from MartinNowak/fix16627

--
December 27, 2016
https://issues.dlang.org/show_bug.cgi?id=16627

--- Comment #5 from github-bugzilla@puremagic.com ---
Commits pushed to scope at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/868ce84e30a3d4e1157e9e72bc3e308b0cd0b1db fix Issue 16627 - non-static structs with postblit/dtor fields now nested

https://github.com/dlang/dmd/commit/8e8541a941bb8fdacf6c8b7a042a69cf77d4676c Merge pull request #6212 from MartinNowak/fix16627

--
January 16, 2017
https://issues.dlang.org/show_bug.cgi?id=16627

--- Comment #6 from github-bugzilla@puremagic.com ---
Commits pushed to newCTFE at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/868ce84e30a3d4e1157e9e72bc3e308b0cd0b1db fix Issue 16627 - non-static structs with postblit/dtor fields now nested

https://github.com/dlang/dmd/commit/8e8541a941bb8fdacf6c8b7a042a69cf77d4676c Merge pull request #6212 from MartinNowak/fix16627

--
December 21, 2018
https://issues.dlang.org/show_bug.cgi?id=16627

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=16607

--