dotnet / dotnet/roslynator

Feature request: detect and suggest discards in tuple deconstruction

Open
#581 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
3.5k
Forks
294
Avg merge
2h 30m
Merged PRs (30d)
4

Description

Code along these lines:

```csharp
var (foo, bar, quux) = MethodThatReturnsATwoTuple();

foo.DoSomething();
// bar is never used and could be discarded
quux.AnotherThing();
```

could be rewritten as:

```csharp
var (foo, _, quux) = MethodThatReturnsATwoTuple();

foo.DoSomething();
quux.AnotherThing();
```

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.