SuppresNullableWarningExpression on switch expressions' governing expressions should suppress CS8655 #43172
Labels
Area-Compilers
New Language Feature - Nullable Reference Types
Nullable Reference Types
New Language Feature - Pattern Matching
Pattern Matching
Projects
Milestone
Version Used:
Steps to Reproduce:
Compile the following code:
Expected Behavior:
No warnings. Suppressed expressions are considered not nullable in all other contexts so this switch's input should be considered not nullable
Actual Behavior:
warning CS8655: The switch expression does not handle some null inputs (it is not exhaustive).
is reportedNotes
The current behavior makes it impossible to easily suppress the warning as the following doesn't work either:
(s switch { {} => 1 })!
The text was updated successfully, but these errors were encountered: