Code analysis IDE0039 quick fix does not respect nullability of async return value #76447
Labels
Area-Compilers
Feature - Nullable Reference Types
Nullable Reference Types
untriaged
Issues and PRs which have not yet been triaged by a lead
This issue has been moved from a ticket on Developer Community.
var testTask = async () =>
{
await Task.Delay(1);
if (Random.Shared.Next(2) == 0)
{
return "test";
}
return null;
};
Quick fix result:
static async Task<string> testTask()
{
await Task.Delay(1);
if (Random.Shared.Next(2) == 0)
{
return "test";
}
return null;
}
It should be Task<string?> because it has a nullable return value "return null"
Original Comments
Feedback Bot on 12/16/2024, 00:24 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
The text was updated successfully, but these errors were encountered: