CS8604 warning when using MaybeNullWhen and return value is assigned #45587
Labels
Area-Compilers
Feature - Nullable Reference Types
Nullable Reference Types
Resolution-Duplicate
The described behavior is tracked in another issue
Version Used: 8.0
Steps to Reproduce:
When calling a method with an
out
parameter annotated withMaybeNullWhen
, the flow analyser seems to fail when the return value is assigned to a variable before being scrutinised.Compile this code with
<Nullable>enable</Nullable>
:Expected Behavior:
No warning in either the
OK
or theWarning
methods. (They self-evidently behave identically.)Actual Behavior:
CS8604 warning ("Possible null reference argument for parameter 'item' in 'void Example.DoSomething(object item)'") inside the
Warning
method.The text was updated successfully, but these errors were encountered: