Code inspection: Assignment results are fully discarded
This inspection reports an assignment or deconstruction where every assigned value is discarded. The assignment itself has no useful target, so the code either does nothing meaningful or is only keeping the right side for its side effects.
Example
class C
{
int M(int x) => x;
void Test()
{
(_, _) = (M(1), M(2));
}
}
class C
{
int M(int x) => x;
void Test()
{
M(1);
M(2);
}
}
Quick-fix
Depending on context, the quick-fix can also replace the assignment with a simpler expression or remove it.
13 April 2026