you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 2 weeks ago

You mean like the "single bracketed expression" syntax we've had since... hell, I don't even know, C#4?

List<string> items =
[
    new(capacity: 10),
    "First",
    "Second",
    "Third"
];
var items = new List<string>(capacity: 10)
{
    "First",
    "Second",
    "Third"
};
  • source
  • parent