From 142c406596c127e83366a7678dfb3aefcd4230c5 Mon Sep 17 00:00:00 2001 From: Pent Ploompuu Date: Wed, 13 Dec 2017 00:59:43 +0200 Subject: [PATCH] Add "private protected" support --- ICSharpCode.Decompiler/CSharp/Syntax/CSharpModifierToken.cs | 2 +- ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs | 3 ++- ICSharpCode.Decompiler/TypeSystem/Accessibility.cs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/CSharpModifierToken.cs b/ICSharpCode.Decompiler/CSharp/Syntax/CSharpModifierToken.cs index d0f6c15fa..01292b740 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/CSharpModifierToken.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/CSharpModifierToken.cs @@ -62,7 +62,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax // Not worth using a dictionary for such few elements. // This table is sorted in the order that modifiers should be output when generating code. static readonly Modifiers[] allModifiers = { - Modifiers.Public, Modifiers.Protected, Modifiers.Private, Modifiers.Internal, + Modifiers.Public, Modifiers.Private, Modifiers.Protected, Modifiers.Internal, Modifiers.New, Modifiers.Unsafe, Modifiers.Abstract, Modifiers.Virtual, Modifiers.Sealed, Modifiers.Static, Modifiers.Override, diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs index abf709ad7..b75feb53f 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs @@ -1057,8 +1057,9 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax case Accessibility.Internal: return Modifiers.Internal; case Accessibility.ProtectedOrInternal: - case Accessibility.ProtectedAndInternal: return Modifiers.Protected | Modifiers.Internal; + case Accessibility.ProtectedAndInternal: + return Modifiers.Private | Modifiers.Protected; default: return Modifiers.None; } diff --git a/ICSharpCode.Decompiler/TypeSystem/Accessibility.cs b/ICSharpCode.Decompiler/TypeSystem/Accessibility.cs index fae4c9673..0122c8883 100644 --- a/ICSharpCode.Decompiler/TypeSystem/Accessibility.cs +++ b/ICSharpCode.Decompiler/TypeSystem/Accessibility.cs @@ -53,7 +53,7 @@ namespace ICSharpCode.Decompiler.TypeSystem /// /// The entity is accessible in derived classes within the same project content. /// - /// C# does not support this accessibility. + /// This corresponds to C# 'private protected'. ProtectedAndInternal, }