Fork me on GitHub
TypeName UnnecessaryParenthesisAnalyzer
Check Id CC0015
Category Style
Severity Warning

Cause

There is no need to specify that the no-parameter constructor is used with an initializer as it is implicit

Example

var p = new Person() { X = 1 };

Code fix

A code fix will be presented to you that will transform the code:

var p = new Person { X = 1 };

Code fix

Related rules

None

See also

TBD