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

Report a diagnostic on missing body in partial property implementation #74224

Merged

Conversation

RikkiGibson
Copy link
Contributor

Closes #74221

@RikkiGibson RikkiGibson requested a review from a team as a code owner July 1, 2024 19:10
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 1, 2024
partial class C
{
public partial int Prop1 { get; set; }
public partial int Prop1 { get => 1; set; }
Copy link
Contributor Author

@RikkiGibson RikkiGibson Jul 1, 2024

Choose a reason for hiding this comment

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

Note that we already have coverage for when a partial property has no accessors with bodies. In that case, the language considers it to be a definition part, and we don't want to report errors on the missing bodies. Basically, the adjusted code path is only going to be hit for partial properties which have 1 accessor with a body, 1 accessor without.

@RikkiGibson RikkiGibson requested a review from a team July 1, 2024 20:46
@RikkiGibson
Copy link
Contributor Author

@dotnet/roslyn-compiler for second review of a small fix

@jcouv jcouv self-assigned this Jul 1, 2024
Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

LGTM Thanks (iteration 2)

@RikkiGibson RikkiGibson merged commit c0c44e1 into dotnet:main Jul 2, 2024
24 checks passed
@RikkiGibson RikkiGibson deleted the partial-properties-impl-missing-body branch July 2, 2024 00:28
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers New Feature - Partial Properties untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Partial properties needs to enforce that all implementation part accessors have bodies
3 participants