Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REG2.067] Issue 15681 - Nested user type enum not retaining value properly #5462

Merged
merged 1 commit into from
Feb 23, 2016

Conversation

9rnsr
Copy link
Contributor

@9rnsr 9rnsr commented Feb 17, 2016

  1. It was a bug in createBlockDuplicatedArrayLiteral function. On array literal construction, the element should be copied when the type has value semantics and the CTFE value has sub payload.
  2. Also the createBlockDuplicatedArrayLiteral callers need to handle the elem argument ownership well.
    2a. In copyLiteral, it didn't copy the source struct element on block assignment.
    2b. In recursivelyCreateArrayLiteral, the elemType.defaultInitLiteral(loc) is not yet CTFE-ed expression. So it should be interpreted to copy it into CTFE world.

1. It was a bug in `createBlockDuplicatedArrayLiteral` function. On array literal construction, the element should be copied when the type has value semantics and the CTFE value has sub payload.

2. Also the `createBlockDuplicatedArrayLiteral` callers need to handle the `elem` argument ownership well.
2a. In `copyLiteral`, it didn't copy the source struct element on block assignment. 2b. In `recursivelyCreateArrayLiteral`, the `elemType.defaultInitLiteral(loc)` is not yet CTFE-ed expression. So it should be interpreted to copy it into CTFE world.
@dlang-bot
Copy link
Contributor

Fix Bugzilla Description
15681 [REG2.067] Nested user type enum not retaining value properly.

@MartinNowak
Copy link
Member

Auto-merge toggled on

MartinNowak added a commit that referenced this pull request Feb 23, 2016
[REG2.067] Issue 15681 - Nested user type enum not retaining value properly
@MartinNowak MartinNowak merged commit 21c35b0 into dlang:stable Feb 23, 2016
@9rnsr 9rnsr deleted the fix15681 branch February 23, 2016 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants