csharplang icon indicating copy to clipboard operation
csharplang copied to clipboard

[Proposal]: Nested members in `with` and object creation

Open 333fred opened this issue 11 months ago • 0 comments

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

333fred avatar Jan 06 '25 22:01 333fred