-
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
[semi-auto-props]: Support assigning properties from constructor #60601
[semi-auto-props]: Support assigning properties from constructor #60601
Conversation
Has "auto-default struct" feature made it to the feature branch? It feels like it might impact some initialization scenarios. In reply to: 1090276403 |
@AlekseyTs I think it got into 17.3 branch but not in |
We should consider integrating main-vs-deps directly into the feature branch then. I think some of the design decisions around this feature were made assuming the "auto-default struct" feature is in place. In reply to: 1090313856 |
@AlekseyTs I opened #60603. |
src/Compilers/CSharp/Test/Semantic/Semantics/PropertyFieldKeywordTests.cs
Outdated
Show resolved
Hide resolved
@AlekseyTs This is ready for review. Can you take a look please? Thanks! |
Is the expected behavior clearly described in the feature specification (a link to the relevant section would be good). Otherwise, it would be good to clearly describe in details what behavior this PR is implementing so that reviewers could "compare" the intent and the implementation. In reply to: 1093069013 |
@AlekseyTs I updated the PR description. Thanks! |
CC @333fred In reply to: 1096978766 |
@AlekseyTs @333fred This should be ready for another look. |
@AlekseyTs CI is still failing after it was restarted. The failure doesn't seem related to the changes. Should a complete new build be started? |
/azp run |
Azure Pipelines successfully started running 4 pipeline(s). |
CC @333fred In reply to: 1117314610 |
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.
Overall this is looking good to me. Just a minor refactor suggestion. (commit 36)
@@ -202,6 +202,9 @@ private void SetGlobalErrorIfTrue(bool arg) | |||
new LocalizableResourceString(messageResourceName, CodeAnalysisResources.ResourceManager, typeof(CodeAnalysisResources))); | |||
} | |||
|
|||
addCircularStructDiagnostics(compilation.GlobalNamespace); |
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.
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.
Yeah compilation.GlobalNamespace
is alot of unnecessary work. I'm switching to compilation.SourceModule.GlobalNamespace
. Thanks!
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.
Yeah compilation.GlobalNamespace is alot of unnecessary work.
It not only a lot of unnecessary work, but also the work that is likely to have negative impact on referenced compilations (work done out of "order").
src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol.cs
Outdated
Show resolved
Hide resolved
Done with review pass (commit 37) |
Done with review pass (commit 38). Besides code changes, I am still tracking this thread for tests #60601 (comment). |
diagnostics.AddRange(compilation.CircularStructDiagnostics); It looks like
I passed |
Responded with a question on it. Thanks a lot for the review and the help you're providing. I very much appreciate it. |
That is the right thing to do in our situation. In reply to: 1119065377 |
Done with review pass (commit 40) |
@Youssef1313 It looks like there is merge conflict to resolve. |
@333fred @AlekseyTs Is this ready to merge? For the next PR*, I'm planning to address small prototype comments (e.g, renaming *I can get to the next PR in few days. So feel free if someone wants to take some work over before I do. |
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 42)
Test plan: #57012
cc @AlekseyTs @333fred
Note: Code I modified is used for both allowing assigning from constructors and also for some data flow. Changes made here were more focused on the first part. Meaning that it could be not correct for data flow which (if possible) I want to leave for now (there are PROTOTYPE comments there).
This implements the following part from LDM notes:
And also, from the original proposal: