Editorconfig Guide.e

Implicit object creation when type is apparent

EditorConfig key: csharp-style-implicit-object-creation-when-type-is-apparent

Implicit object creation when type is apparent

csharp-style-implicit-object-creation-when-type-is-apparent

This option controls whether target-typed new expressions should be preferred when the type is apparent from the declaration.

Default value:

true

Possible values:

  • true
  • false

Examples

true
List<int> x = new();
false
List<int> x = new List<int>();