Code inspection: Local function return value is never used
This inspection reports a local function whose return value is ignored at every call site. In that case, the function probably should not return anything.
Example
void M()
{
int UnusedReturn() => 5;
UnusedReturn();
}
void M()
{
void UnusedReturn()
{
_ = 5;
}
UnusedReturn();
}
Quick-fix
The quick-fix changes the return type of the local function to void.
13 April 2026