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.
csharp_style_expression_bodied_indexers = false
namespace N;
public class Widget
{
private int[] _data = new int[10];
public int this[int index]
{
get { return _data[index]; }
}
}
namespace N;
public class Widget
{
private int[] _data = new int[10];
public int this[int index]
{
get { return _data[index]; }
}
}
csharp_style_expression_bodied_indexers = true
namespace N;
public class Widget
{
private int[] _data = new int[10];
public int this[int index]
{
get { return _data[index]; }
}
}
namespace N;
public class Widget
{
private int[] _data = new int[10];
public int this[int index] => _data[index];
}
csharp_style_expression_bodied_indexers = when_on_single_line
namespace N;
public class Widget
{
private int[] _data = new int[10];
public int this[int index]
{
get { return _data[index]; }
}
}
namespace N;
public class Widget
{
private int[] _data = new int[10];
public int this[int index]
{
get { return _data[index]; }
}
}