Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Check for BackingField instead of IsAutoProperty in NullableWalker #75872

Merged

Conversation

RikkiGibson
Copy link
Contributor

@RikkiGibson RikkiGibson commented Nov 12, 2024

Closes #75245

It looks like this function is still needed for some complex cases involving required properties, MemberNotNull applied to setters, and constructor chaining. I adjusted the function to behave correctly with properties using the field keyword as well.

It looks like this function is no longer needed because we recently added a mechanism to share a slot between property and backing field under appropriate conditions. Specifically, changes to NullableWalker.GetOrCreateSlot in #75246.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 12, 2024
@RikkiGibson RikkiGibson changed the title Remove get field symbol to be initialized Remove getFieldSymbolToBeInitialized Nov 12, 2024
@RikkiGibson

This comment was marked as resolved.

@RikkiGibson RikkiGibson changed the title Remove getFieldSymbolToBeInitialized Check for BackingField instead of IsAutoProperty in NullableWalker.Scan.getFieldSymbolToBeInitialized Nov 20, 2024
@RikkiGibson RikkiGibson changed the title Check for BackingField instead of IsAutoProperty in NullableWalker.Scan.getFieldSymbolToBeInitialized Check for BackingField instead of IsAutoProperty in NullableWalker Nov 20, 2024
@RikkiGibson RikkiGibson marked this pull request as ready for review November 20, 2024 20:01
@RikkiGibson RikkiGibson requested a review from a team as a code owner November 20, 2024 20:01
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)

@RikkiGibson RikkiGibson merged commit 9b2cd5d into dotnet:main Nov 21, 2024
24 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Nov 21, 2024
@RikkiGibson RikkiGibson deleted the remove-getFieldSymbolToBeInitialized branch November 21, 2024 19:16
@jjonescz jjonescz modified the milestones: Next, 17.13 P2 Nov 25, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
4 participants