Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/csharp/whats-new/csharp-6.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,12 @@ if any, is lost.
## Index Initializers

*Index Initializers* is one of two features that make collection
initializers more consistent. In earlier releases of C#, you could use
*collection initializers* only with sequence style collections:
initializers more consistent with index usage. In earlier releases of C#, you could use
*collection initializers* only with sequence style collections, including <xref:System.Collections.Generic.Dictionary%602> by adding braces around key and value pairs:

[!code-csharp[ListInitializer](../../../samples/snippets/csharp/new-in-6/initializers.cs#ListInitializer)]

Now, you can also use them with <xref:System.Collections.Generic.Dictionary%602> collections and similar types:
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:

[!code-csharp[DictionaryInitializer](../../../samples/snippets/csharp/new-in-6/initializers.cs#DictionaryInitializer)]

Expand Down