Skip to content

Casting line overflow separates cast type and variable #1287

@charliefoxtwo

Description

@charliefoxtwo

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);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions