Skip to content

Missing docs and example on object initializer that lacks a new keyword #12979

@AArnott

Description

@AArnott

From C# ecma spec 12.7.11.3 it is possible to initialize values into a member using a = { } syntax (note the lack of the new keyword). By this it's possible to initialize a new object deeply within its properties that may not even make a setter available. This is very interesting and useful, and should be documented here.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.


Associated WorkItem - 446787

Metadata

Metadata

Labels

📌 seQUESTeredIdentifies that an issue has been imported into Quest.dotnet-csharp/svcfundamentals/subsvcin-prThis issue will be closed (fixed) by an active pull request.okr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions