if (NextNonComment->is(TT_ArraySubscriptLSquare)) {
if (State.Stack.back().StartOfArraySubscripts != 0)
return State.Stack.back().StartOfArraySubscripts;
- else if (Style.isCSharp()) // C# allows `["key"] = value` inside object
- // initializers.
- return State.Stack.back().Indent;
return ContinuationIndent;
}
Scaler = (Shape shape) => { return new Transform.Resize(shape, 0.1); },
};)",
Style);
-
- // Dictionary initialisation.
- verifyFormat(R"(//
-var myDict = new Dictionary<string, string> {
- ["name"] = _donald,
- ["age"] = Convert.ToString(DateTime.Today.Year - 1934),
- ["type"] = _duck,
-};)",
- Style);
}
TEST_F(FormatTestCSharp, CSharpNamedArguments) {