Skip to main content

RCS1050: Include/omit parentheses when creating new object

Properties

PropertyValue
Default Severitydisabled by default
Minimum language version-

Examples

Example #1

diagnostic.cs
var items = new List<string> { "a", "b", "c"  };
fix.cs
var items = new List<string>() { "a", "b", "c"  };

Configuration

info

Option roslynator_object_creation_parentheses_style is required to be set for this analyzer to work.

.editorconfig
# Include/omit parentheses when creating new object
roslynator_object_creation_parentheses_style = include|omit

Applies to