Learn from non-null tests on as operator#41419
Conversation
|
Done with review pass (iteration 2) |
RikkiGibson
left a comment
There was a problem hiding this comment.
My comments didn't show up because I used GitHub incorrectly. Sorry about that.
|
|
||
| [Fact] | ||
| [WorkItem(39424, "https://github.com/dotnet/roslyn/issues/39424")] | ||
| public void LearnFromNullCoalescingFalse() |
There was a problem hiding this comment.
Was this test just added in this PR? It looks like one I added when I added support for learning from null coalescing
There was a problem hiding this comment.
Yes, I just added it.
After looking for tests with ?? false, I found ConditionalBranching_19 which covers this scenario. So I'll remove this test and close the issue (as already fixed and verified)
| } | ||
|
|
||
| [Fact, WorkItem(38522, "https://github.com/dotnet/roslyn/issues/38522")] | ||
| public void AsType_LearningFromNotNullTest() |
There was a problem hiding this comment.
Is there a test that demonstrates when (if ever) this check should be pure or not?
I would be interested in cases where the as type is exactly the same as the expression, and in places where it’s a different type
* dotnet/master: (918 commits) Pure null test on unconstrained type (dotnet#41384) Fix file headers, bootsrap build issues. Make `elementLocations` accept an array of nullable locations in the public api. Learn from non-null tests on as operator (dotnet#41419) Use Microsoft.NET.Sdk.WindowsDesktop for XAML projects (dotnet#40234) Address feedback. Introduce `GetRequiredBinder`. Add missing `NotNullWhen` annotations. Annotate more of the binder Add version of zlib library to deterministic build inputs (dotnet#41385) [master] Update dependencies from dotnet/arcade (dotnet#41354) Simplify Simplify Do not simplify interpolation expressions on implicit receivers. Fix local function crash + add tests Substituted symbol equality (dotnet#41123) Fix test failures Rename from IncludeNonNullableReferenceTypeModifier to IncludeNotNullableReferenceTypeModifier (dotnet#41332) Set TEMP environment variable to $TempDir on CI machines (dotnet#41361) Document placeholders ...
If we learn that
x as Typeis not null, then we can learn thatxwas not null.Fixes #38522
Closes #39424