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

[17.0] Report errors for structs with missing field initializers and implicit parameterless constructor #59055

Merged
merged 3 commits into from
Feb 16, 2022

Conversation

cston
Copy link
Member

@cston cston commented Jan 25, 2022

Port fixes to 17.0 for two cases where invalid code is generated for struct constructors with missing field initializers. In both cases, compile errors are now reported instead.

Commits are ports of fixes for #58328 (commits 1 and 2) and #57870 (commit 3):

  1. Report error if 'record struct' constructor calls default parameterless constructor #58339
  2. Improve error reporting for 'this()' initializer from 'record struct' constructor #58430
  3. Require definite assignment of all fields if struct includes any field initializers #57925

Breaking change documentation: see #59245

@cston cston marked this pull request as ready for review January 25, 2022 19:30
@cston cston requested a review from a team as a code owner January 25, 2022 19:30
@jcouv jcouv added this to the 17.0 milestone Jan 26, 2022
Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

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

LGTM (commit 2), assuming CI is passing.

@cston cston changed the title [17.0] Report error if 'record struct' constructor calls default parameterless constructor [17.0] Report errors for structs with missing field initializers and implicit parameterless constructor Jan 26, 2022
@cston cston requested review from AlekseyTs and jcouv January 26, 2022 19:41
Copy link
Contributor

@AlekseyTs AlekseyTs left a comment

Choose a reason for hiding this comment

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

LGTM (commit 3), assuming CI is passing.

@RikkiGibson RikkiGibson merged commit ff289c4 into dotnet:release/dev17.0-vs-deps Feb 16, 2022
@cston cston deleted the 58328-17.0 branch March 15, 2024 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants