Nullable Reference Types: Compiler should not report CS8603 when assignment exists in the right-hand side of a null coalescing operator #27009
Labels
Area-Compilers
New Language Feature - Nullable Reference Types
Nullable Reference Types
Test
Test failures in roslyn-CI
Milestone
Version Used: 05/14/18 Nullable Reference Types Preview (
csc
reports2.8.0.62830 (e595ee27)
) with Visual Studio 15.7.1Demonstration Code:
I've created PathogenPlayground/NullCoalescingOperatorCs8603 to demonstrate the issue.
Steps to Reproduce:
Compile the following code, where
Foo
is a class:Edit: The issue also happens when the null coalescing operator is not in play:
Expected Behavior:
No warnings are reported.
Actual Behavior:
Possible null reference return is reported for the return statement in each property.
The readme on PathogenPlayground/NullCoalescingOperatorCs8603 contains some additional details.
FooProperty2
exists to make sure the problem isn't somehow related to #9978The text was updated successfully, but these errors were encountered: