dotnet / dotnet/dotnet-api-docs

ChannelReader<T>.ReadAsync is incorrectly shown to return nullable ValueTask<T>

Open
#5,126 1 comment 0 reactions 0 assignees View on GitHub
area-System.Threading.Tasks docs-experience Pri3 untriaged
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.threading.channels.channelreader-1.readasync?view=net-5.0 shows this C# code block:

```cs
public virtual System.Threading.Tasks.ValueTask? ReadAsync (System.Threading.CancellationToken cancellationToken = default);
```

The question mark is incorrect. The real return type is `ValueTask`, not `System.Nullable>`.

https://github.com/dotnet/runtime/blob/v5.0.0-rtm.20519.4/src/libraries/System.Threading.Channels/src/System/Threading/Channels/ChannelReader.cs#L44

https://github.com/dotnet/runtime/blob/v5.0.0-rtm.20519.4/src/libraries/System.Threading.Channels/ref/System.Threading.Channels.cs#L49

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.