Skip to content

BRO1116: Closing parenthesis should be on line of opening parenthesis

An empty parameter or argument list is written (). Replaces StyleCop SA1112.

Example

Before

public class Timer
{
    public void Start(
    )
    {
        this.Reset(
            );
    }

    public void Reset()
    {
    }
}

After

public class Timer
{
    public void Start()
    {
        this.Reset();
    }

    public void Reset()
    {
    }
}

Why

An empty list split over two lines looks as if something was deleted from it.

How the fix works

The line break and spaces between the parentheses are removed.

Not reported

  • Attributes ([Obsolete( + )]), like StyleCop; BRO1402 removes empty attribute parentheses altogether.
  • A comment between the parentheses.

Compared with StyleCop

Same positions and the same fixed output as StyleCop.