diff --git a/ICSharpCode.NRefactory/CSharp/Ast/ComposedType.cs b/ICSharpCode.NRefactory/CSharp/Ast/ComposedType.cs index ce8ad9879c..b888cdea23 100644 --- a/ICSharpCode.NRefactory/CSharp/Ast/ComposedType.cs +++ b/ICSharpCode.NRefactory/CSharp/Ast/ComposedType.cs @@ -55,6 +55,8 @@ namespace ICSharpCode.NRefactory.CSharp return GetChildrenByRole(PointerRole).Count(); } set { + if (value < 0) + throw new ArgumentOutOfRangeException(); int d = this.PointerRank; while (d > value) { GetChildByRole(PointerRole).Remove(); diff --git a/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs b/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs index f12d3ffac8..da843f39cc 100644 --- a/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs +++ b/ICSharpCode.NRefactory/CSharp/OutputVisitor/OutputVisitor.cs @@ -1387,9 +1387,13 @@ namespace ICSharpCode.NRefactory.CSharp { StartNode(fixedStatement); WriteKeyword("fixed"); + Space(policy.UsingParentheses); LPar(); + Space(policy.WithinUsingParentheses); fixedStatement.Type.AcceptVisitor(this, data); + Space(); WriteCommaSeparatedList(fixedStatement.Variables); + Space(policy.WithinUsingParentheses); RPar(); WriteEmbeddedStatement(fixedStatement.EmbeddedStatement); return EndNode(fixedStatement);