-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Implement conditional expression changes in definite assignment #51498
Implement conditional expression changes in definite assignment #51498
Conversation
@dotnet/roslyn-compiler please review. |
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 Thanks (iteration 5)
I think it would be worth adding some variations of these tests (where the condition is DAT/F) and the branch is a constant value. ie, something like Refers to: src/Compilers/CSharp/Test/Semantic/FlowAnalysis/FlowTests.cs:1752 in f126ebe. [](commit_id = f126ebe, deletion_comment = False) |
Also, is In reply to: 789277456 [](ancestors = 789277456) Refers to: src/Compilers/CSharp/Test/Semantic/FlowAnalysis/FlowTests.cs:1752 in f126ebe. [](commit_id = f126ebe, deletion_comment = False) |
Done review pass (commit 5) |
Does this refer to unary not or to nullable suppression? |
Unary not. |
I have added a related test case in |
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 6)
Note that ed38577 simply deletes and regenerates the baseline in order to make comparison easier in the subsequent commit.
I decided to do this bit first, as the precise method of doing it had been in my head. There are corresponding nullable analysis changes I'd like to make, but nullable does more complex things with conditional expressions. Therefore I'd like to do those changes in a subsequent PR.
/cc @jcouv
Implementation of part of dotnet/csharplang#4472. The relevant spec sections implemented in this PR are:
Relates to test plan #51463