-
-
Notifications
You must be signed in to change notification settings - Fork 70
Closed as not planned
Labels
wontfixThis will not be worked onThis will not be worked on
Description
Description (optional)
Add an extension to KeyValuePair<TKey, TValue> that mirrors https://learn.microsoft.com/en-US/dotnet/api/system.collections.generic.keyvaluepair-2.deconstruct?view=net-7.0
Rationale
The extension allows for KeyValuePairs to be deconstructed in scenarios such as
foreach ((var k, var v) in dict)
{
// ...
}Proposed API
https://learn.microsoft.com/en-US/dotnet/api/system.collections.generic.keyvaluepair-2.deconstruct?view=net-7.0 Allows the compiler to deconstruct KeyValuePairs in tuple patterns or other tuple-like scenarios
Drawbacks
Not known
Alternatives
Not known
Other thoughts
None
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
wontfixThis will not be worked onThis will not be worked on