dotnet / dotnet/dotnet-api-docs
The ReferenceEqualityComparer.Instance property is incorrectly shown as nullable
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 52
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
Research direction
Compare the API page's nullable ReferenceEqualityComparer.Instance signature with the runtime declarations in src/libraries/Common/src/System/Collections/Generic/ReferenceEqualityComparer.cs and src/libraries/System.Collections/ref/System.Collections.cs. Start by checking how the documentation tooling derives the signature. Done means the generated API reference shows the property as non-nullable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100