dotnet / dotnet/dotnet-api-docs
The ReferenceEqualityComparer.Instance property is incorrectly shown as nullable
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.referenceequalitycomparer.instance?view=net-5.0:
> ```cs
> public static System.Collections.Generic.ReferenceEqualityComparer? Instance { get; }
> ```
Having this property be nullable makes no sense. Docs tooling bug maybe? The .NET Core source shows that it's not nullable:
https://github.com/dotnet/runtime/blob/v5.0.0-rc.1.20451.14/src/libraries/Common/src/System/Collections/Generic/ReferenceEqualityComparer.cs#L30
```cs
///
/// Gets the singleton instance.
///
public static ReferenceEqualityComparer Instance { get; } = new ReferenceEqualityComparer();
```
https://github.com/dotnet/runtime/blob/v5.0.0-rc.1.20451.14/src/libraries/System.Collections/ref/System.Collections.cs#L418
```cs
public static System.Collections.Generic.ReferenceEqualityComparer Instance { get { throw null; } }
```
Contributor guide
Assessment
This issue has not been assessed yet.