You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update csharp-6
Modified Index Initializer verbiage to identify collection initializers were able to be used with Dictionaries previously. Tried to identify that the change makes use of the indexer versus calling the add method by remaining more consistent with index usage. Might want to update example or links to the Dictionary collection initializer page within docs.
* Index Initializer #5506
Update typo and verbiage in accordance with reviewed comments.
Copy file name to clipboardExpand all lines: docs/csharp/whats-new/csharp-6.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -508,12 +508,12 @@ if any, is lost.
508
508
## Index Initializers
509
509
510
510
*Index Initializers* is one of two features that make collection
511
-
initializers more consistent. In earlier releases of C#, you could use
512
-
*collection initializers* only with sequence style collections:
511
+
initializers more consistent with index usage. In earlier releases of C#, you could use
512
+
*collection initializers* only with sequence style collections, including <xref:System.Collections.Generic.Dictionary%602> by adding braces around key and value pairs:
Now, you can also use them with <xref:System.Collections.Generic.Dictionary%602> collections and similar types:
516
+
Now, you can use them with <xref:System.Collections.Generic.Dictionary%602> collections and similar types. The new syntax supports assignment using an index into the collection:
0 commit comments