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

Casting line overflow separates cast type and variable #1287

Open
charliefoxtwo opened this issue Jun 8, 2024 · 1 comment
Open

Casting line overflow separates cast type and variable #1287

charliefoxtwo opened this issue Jun 8, 2024 · 1 comment

Comments

@charliefoxtwo
Copy link
Sponsor

A type cast seems to me like it should be kept together with the object being casted, when possible.

Input:

public class ClassName
{
    public void Foo()
    {
        var myJsonSerializerContract = (JsonObjectContract)serializer.ContractResolver.ResolveContract(returnType);
    }
}

Output:

public class ClassName
{
    public void Foo()
    {
        var myJsonSerializerContract = (JsonObjectContract)
            serializer.ContractResolver.ResolveContract(returnType);
    }
}

Expected behavior:

public class ClassName
{
    public void Foo()
    {
        var myJsonSerializerContract =
             (JsonObjectContract) serializer.ContractResolver.ResolveContract(returnType);
    }
}
@belav
Copy link
Owner

belav commented Jun 16, 2024

This seems reasonable to me

@belav belav added this to the Planned milestone Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants