Description
hi,
S8969 reports false positive when value comes from a nullable out parameter. (VS 2026 18.8.1, .net SDK 10.0.302)
Reproducer
//think of something like try get from a dictionary
static bool SomeMtd([NotNullWhen(true)] out object? x)
{
x = new();
return true;
}
//...
object x = null!;
if(!SomeMtd(out x!))
return;
//...
omitting the ! in out parameter triggers CS8601:
//...
if(!SomeMtd(out x)) //CS8601
//...
not %100 sure but CS8601 seems right to be conservative here: non-nullable x might come back as null from that method.
Product and Version
10.30.0.144632
Description
hi,
S8969 reports false positive when value comes from a nullable out parameter. (VS 2026 18.8.1, .net SDK 10.0.302)
Reproducer
omitting the
!in out parameter triggers CS8601:not %100 sure but CS8601 seems right to be conservative here: non-nullable
xmight come back as null from that method.Product and Version
10.30.0.144632