Skip to content

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

Merged
RikkiGibson merged 3 commits intodotnet:release/dev17.0-vs-depsfrom
cston:58328-17.0
Feb 16, 2022
Merged

[17.0] Report errors for structs with missing field initializers and implicit parameterless constructor#59055
RikkiGibson merged 3 commits intodotnet:release/dev17.0-vs-depsfrom
cston:58328-17.0

Conversation

@cston
Copy link
Copy Markdown
Contributor

@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

@ghost ghost added the Area-Compilers label Jan 25, 2022
@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
Copy Markdown
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
Copy Markdown
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