dotnet / dotnet/csharplang

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

Open
#9,003 0 comments 0 reactions 1 assignee Claimed by @jcouv View on GitHub
Proposal champion
Dominant language
C#
Stars
12.7k
Forks
1.1k
Avg merge
11h 1m
Merged PRs (30d)
3

Description

# Nested members in `with` and object creation

* Specification: None yet
* Discussion: https://github.com/dotnet/csharplang/discussions/9002

## Summary
[summary]: #summary

If we go ahead and add support for [extended names in property patterns](https://github.com/dotnet/csharplang/issues/4394) (`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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.