Skip to main content

Use index initializer

PropertyValue
IdRR0191
Applicable Syntaxcollection initializer
Enabled by Default

Usage

Example #1

before.cs
var dic = new Dictionary<int, string>() { { 0, "0" } };
after.cs
var dic = new Dictionary<int, string>() { [0] = "0" };

Configuration

roslynator_refactoring.use_index_initializer.enabled = true|false