-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Refactor IsAutoPropertyWithGetAccessor usage in MethodCompiler #58515
Refactor IsAutoPropertyWithGetAccessor usage in MethodCompiler #58515
Conversation
src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_AssignmentOperator.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertySymbolBase.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertySymbolBase.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertySymbolBase.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertySymbolBase.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedBackingFieldSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedBackingFieldSymbol.cs
Outdated
Show resolved
Hide resolved
Done with review pass (commit 2) |
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertyAccessorSymbol.cs
Outdated
Show resolved
Hide resolved
@AlekseyTs I reverted all the simple inlinings for now. |
...ers/CSharp/Portable/Symbols/Synthesized/Records/SynthesizedRecordEqualityContractProperty.cs
Outdated
Show resolved
Hide resolved
It looks like we can remove this parameter completely, In reply to: 1002657565 Refers to: src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertyAccessorSymbol.cs:188 in 6d53a72. [](commit_id = 6d53a72, deletion_comment = False) |
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertyAccessorSymbol.cs
Outdated
Show resolved
Hide resolved
Would it make sense to rename this to "hasBlockBody"? In reply to: 1002661648 Refers to: src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertyAccessorSymbol.cs:198 in 6d53a72. [](commit_id = 6d53a72, deletion_comment = False) |
src/Compilers/CSharp/Portable/Compiler/MethodBodySynthesizer.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertySymbolBase.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertyAccessorSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertyAccessorSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertySymbolBase.cs
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertySymbolBase.cs
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertyAccessorSymbol.cs
Outdated
Show resolved
Hide resolved
Done with review pass (commit 9) |
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertyAccessorSymbol.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Symbols/Source/SourcePropertyAccessorSymbol.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 12)
@333fred, @dotnet/roslyn-compiler For the second review. |
@AlekseyTs Is there any more refactoring needed before continuing working on the feature? If not, then the next step is looking at supporting mixed scenarios right? (#57076 (comment) for reference) |
I think there is. We need to examine other usages of "AutoProperty" related APIs and introduce suitable abstractions that can be used instead and were not about the "AutoProperty" term. I gave you an example here #58515 (comment). The theory there is probably not quite accurate, but it should be possible to get the idea. Let's start with that specific place and go from there. Also, before we start working on any behavior changes, I would like us to get earlier identified tests in place. In particular those about |
The link to the comment doesn't quite work. It was about a change in earlier iteration of this PR in Here is the interesting part:
Again, without significant additional thinking, I have an idea that it might help to add a couple of properties to SourcePropertySymbolBase instead. Something like:
Perhaps the Just think about what you can come up with. The goal is to introduce abstractions that do not refer to "AutoProperty" and at the same time likely to have an application for semi-auto properties, or have no relation to them at all. |
So |
Pretty much. However, it would be good to move away from using "an auto property" term even in implementation, when possible. For example, the implementation for properties could be as simple as a check whether |
@333fred, @dotnet/roslyn-compiler For the second review. |
@333fred, @dotnet/roslyn-compiler For the second review of a community PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 12)
@AlekseyTs This might not be what you're expecting. It's not much clear to me what "clean up" is needed.
Test plan: #57012
Proposal: dotnet/csharplang#140