Skip to content

Conversation

@MartinNowak
Copy link
Member

@dlang-bot
Copy link
Contributor

Fix Bugzilla Description
16627 [Reg 2.072] non-static structs with postblit/dtor fields are now nested

@MartinNowak MartinNowak added the Severity:Regression PRs that fix regressions label Oct 24, 2016
@MartinNowak MartinNowak added this to the 2.072.0 milestone Oct 24, 2016
@WalterBright
Copy link
Member

This is rather hackish to use the storage class to transmit a flag. I can feel the technical debt :-) Perhaps use a FUNCFLAG bit instead?

@MartinNowak
Copy link
Member Author

MartinNowak commented Oct 24, 2016

I can feel the technical debt :-)

In the mid-term, I'd be in favor to deprecating these non-static, but unnested, structs, requiring people to always explicitly use static struct. Can you clarify the original intention behind this? Was it just a simple PODs don't need a context optimization?

…sted

- Since dlang#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.
@MartinNowak
Copy link
Member Author

MartinNowak commented Oct 24, 2016

Found that I can reuse the generated flag in FuncDeclaration.
Still clarifying the specs for the current behavior would be appreciated, it wasn't inferable from the code.

Nested structs have member functions

The spec page mentions this (see Nested Structs mentions), could use a bit more explanation though.

@WalterBright
Copy link
Member

Can you clarify the original intention behind this?

I don't recall it. But being in the spec, it is clearly intentional, and seems like a good idea :-)

@WalterBright WalterBright merged commit 8e8541a into dlang:stable Oct 25, 2016
@MartinNowak MartinNowak deleted the fix16627 branch October 25, 2016 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Severity:Regression PRs that fix regressions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants