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

Handle field initialization using force-move assignment #741

Merged
merged 1 commit into from
Mar 30, 2021

Conversation

turbolent
Copy link
Member

@turbolent turbolent commented Mar 30, 2021

Closes #739

Description

Assignment using the force-move operator gets the current value, and if it is non-nil, aborts the program.

However, when the force-move operator is used in an initializer to initialize a field, getting the value will naturally result in no value, which is not an implementation error like in all other cases (e.g. in a non-initializer like a function).


  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

Copy link
Member

@joshuahannan joshuahannan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing!

@turbolent turbolent merged commit 3bbc8c8 into master Mar 30, 2021
@turbolent turbolent deleted the bastian/739-force-assign-in-initializer branch March 30, 2021 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Field initialization using force assignment results in panic
3 participants