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

Field-backed properties: interface properties #75219

Merged
merged 3 commits into from
Sep 25, 2024

Conversation

cston
Copy link
Member

@cston cston commented Sep 24, 2024

Fixes for properties on interface types:

  • Report error if synthesized field is required for instance property (found running tests from features/semi-auto-props)
  • Allow combination of auto- and manually-implemented accessors
  • Tests for partial properties

@cston cston requested a review from a team as a code owner September 24, 2024 16:21
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Sep 24, 2024
@@ -63,7 +63,7 @@ private static SourcePropertySymbol Create(
out _);

bool allowAutoPropertyAccessors = (modifiers & (DeclarationModifiers.Abstract | DeclarationModifiers.Extern | DeclarationModifiers.Indexer)) == 0 &&
(!containingType.IsInterface || (modifiers & DeclarationModifiers.Static) != 0) &&
(!containingType.IsInterface || hasGetAccessorImplementation || hasSetAccessorImplementation || (modifiers & DeclarationModifiers.Static) != 0) &&
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: it looks like it would be simpler here to use 'accessorsHaveImplementation' as well as on the next line

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, I'd overlooked accessorsHaveImplementation. Let's simplify this in a follow up PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers 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.

3 participants