csharp_style_expression_bodied_indexers

Convert eligible block-bodied indexers. IDE0026. Skipped where the project compiles below C# 6, or below C# 7 for a body that only throws.

Value Notes
false
true
when_on_single_line

Default: false

No known case where Curb's output is not a fixed point of dotnet format — see conformance.

Ini
csharp_style_expression_bodied_indexers = false
C#
namespace N;

public class Widget
{
    private int[] _data = new int[10];

    public int this[int index]
    {
        get { return _data[index]; }
    }
}
C#
namespace N;

public class Widget
{
    private int[] _data = new int[10];

    public int this[int index]
    {
        get { return _data[index]; }
    }
}
Ini
csharp_style_expression_bodied_indexers = true
C#
namespace N;

public class Widget
{
    private int[] _data = new int[10];

    public int this[int index]
    {
        get { return _data[index]; }
    }
}
C#
namespace N;

public class Widget
{
    private int[] _data = new int[10];

    public int this[int index] => _data[index];
}
Ini
csharp_style_expression_bodied_indexers = when_on_single_line
C#
namespace N;

public class Widget
{
    private int[] _data = new int[10];

    public int this[int index]
    {
        get { return _data[index]; }
    }
}
C#
namespace N;

public class Widget
{
    private int[] _data = new int[10];

    public int this[int index]
    {
        get { return _data[index]; }
    }
}