csharplang
csharplang copied to clipboard
[Proposal]: Nested members in `with` and object creation
Nested members in with and object creation
- Specification: None yet
- Discussion: https://github.com/dotnet/csharplang/discussions/9002
Summary
If we go ahead and add support for extended names in property patterns (if (e is MethodCallExpression { Method.Name: "MethodName" })), it makes sense for symmetry to allow this in with and object creation expressions:
methodCallExpression with { Method.Name = "MethodName" }
new MethodCallExpression(...) { Method.Name = "MethodName" }
Design meetings
- https://github.com/dotnet/csharplang/blob/main/meetings/2021/LDM-2021-09-22.md#nested-members-in-with-and-object-creation
- https://github.com/dotnet/csharplang/blob/main/meetings/2022/LDM-2022-01-24.md#nested-members-in-with-and-object-creation