Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove empty ArgumentList when creating object initializer #80

Open
Flash0ver opened this issue Jun 11, 2021 · 0 comments
Open

Remove empty ArgumentList when creating object initializer #80

Flash0ver opened this issue Jun 11, 2021 · 0 comments
Labels
codeanalysis-coderefactorings Microsoft.CodeAnalysis.CodeRefactorings enhancement New feature or request

Comments

@Flash0ver
Copy link
Owner

When creating an object initializer via F0.CodeAnalysis.CodeRefactorings.ObjectInitializer,
and the type has either the implicit default constructor or an explicit parameterless constructor,
then the ObjectInitializerExpression should not have an empty ArgumentList:

Examples:

var tuple = new ValueTuple<int, bool, string>();

var tuple = new ValueTuple<int>
{
    Item1 = default,
};
var textWriter = new IndentedTextWriter();

var textWriter = new IndentedTextWriter()
{
    Indent = default,
    NewLine = default
};
@Flash0ver Flash0ver added codeanalysis-coderefactorings Microsoft.CodeAnalysis.CodeRefactorings roslyn-analyzers .NET analyzers enhancement New feature or request and removed roslyn-analyzers .NET analyzers labels Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codeanalysis-coderefactorings Microsoft.CodeAnalysis.CodeRefactorings enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant