-
Hello, between all the absurd I have seen in the last years recently VS is asking me to change list initialization from So, my question is: Mixing up a list with an array stuff, is this a bug somehow or is it due to the Python developers not being satisfied enough producing garbage in the Python language that now they want to destroy all other programming languages? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 14 replies
-
The |
Beta Was this translation helpful? Give feedback.
-
Collection expression in C# is more like |
Beta Was this translation helpful? Give feedback.
-
Brackets are used for far more than arrays in c#. A very important correspondence here which has already shipped is Collection initializers are just the construction form of that. |
Beta Was this translation helpful? Give feedback.
-
Why limit [] just to arrays? Because it feels nice? What would the alternative for a simple, all-encompassing syntax that works for all collection types be? |
Beta Was this translation helpful? Give feedback.
The
[]
syntax is a new feature fromC# 12
. See #5354And the reason why vs raises the suggestion, it may be related to microsoft/vscode-dotnettools#419. If the project built with no error, that's not a bug because there's a preview version sdk in your machine for sure. If not, that's what confused me about the langVersion and SDKs.