Learn from comparisons to non-constant, non-null values#35953
Learn from comparisons to non-constant, non-null values#35953RikkiGibson merged 10 commits intodotnet:masterfrom
Conversation
src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs
Show resolved
Hide resolved
The non-null case changed to work for any expression determined to be non-null, not just constants. Does this need to change too? #Closed Refers to: src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs:2076 in e8567ea. [](commit_id = e8567ea, deletion_comment = False) |
src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs
Outdated
Show resolved
Hide resolved
|
Done review pass (commit 4) |
I don't think so. I think this can stay as-is. There are two categories: (1) null constant (most confidence of nullness), and (2) maybe-null expressions (this is the most conservative inference). I don't think we can learn from a maybe-null expression, because it offers less confidence than a null constant (the In reply to: 495802426 [](ancestors = 495802426) Refers to: src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.cs:2076 in e8567ea. [](commit_id = e8567ea, deletion_comment = False) |
src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs
Outdated
Show resolved
Hide resolved
jcouv
left a comment
There was a problem hiding this comment.
Done with review pass (iteration 7)
src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Semantic/Semantics/NullableReferenceTypesTests.cs
Outdated
Show resolved
Hide resolved
jcouv
left a comment
There was a problem hiding this comment.
LGTM. Thanks for your patience!
Resolves #34942