Champion "deconstruction in from and let" #8874
Replies: 7 comments
-
Is there any progress on this? The more one gets used to deconstruction, the more annoying it becomes that |
Beta Was this translation helpful? Give feedback.
-
This feature is in the Any Time bucket, which means we are unlikely to spend time on it ourselves, but if a motivated community member would like to contribute, we would be happy to review. Currently, this issue needs a specification for LDM to review and approve. |
Beta Was this translation helpful? Give feedback.
-
Any chance this could make it in C# 12? |
Beta Was this translation helpful? Give feedback.
-
@jhgbrt see the comment above yours. |
Beta Was this translation helpful? Give feedback.
-
Does this cover things like from person in People
where person.Age is int age && age >= 18 // person.Age is a nullable int
select (person, age) or would that be a separate ticket? |
Beta Was this translation helpful? Give feedback.
-
I don't think that would be covered by this. That would be changing the scoping of existing code, which would be concerning. |
Beta Was this translation helpful? Give feedback.
-
Oof. I see what you mean - my code example would compile today if something called Of course, breaking existing code is a big deal and should only be done in extenuating circumstances. But does "the code is probably not doing what they intended in the first place" count as an extenuating circumstance? |
Beta Was this translation helpful? Give feedback.
-
Summary
Allow declaring multiple range at once with
let
. For example,... let (x, y) = deconstructable ...
.See also dotnet/roslyn#13964
https://github.com/dotnet/csharplang/blob/master/meetings/2016/LDM-2016-12-07-14.md#deconstruction
Beta Was this translation helpful? Give feedback.
All reactions