Inconsistent nullable warning behavior involving the null-forgiving operator on the left-hand-side
Open
Area-Compilers
Feature - Nullable Reference Types
Feature - Tuples
- Dominant language
- C#
- Stars
- 20.7k
- Forks
- 4.3k
- PR merge metrics
- PR metrics pending
Description
There is inconsistent design around nullable diagnostics, illustrated below.
```csharp
class C
{
void M(
ref object o,
ref object p)
{
// error CS8598
(o!) = null;
// warning CS8600, despite ! operator
(o!, p!) = (1, null);
// no warning
(o!, p!) = this;
// no warning
// Deconstruct(out o!, out p!);
}
void Deconstruct(
out object? o,
out object? p)
{
o = null;
p = null;
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.