|
|
|
@ -1406,6 +1406,7 @@ namespace ICSharpCode.Decompiler.CSharp
@@ -1406,6 +1406,7 @@ namespace ICSharpCode.Decompiler.CSharp
|
|
|
|
|
attr.Remove(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
RemoveCompilerFeatureRequiredAttribute(typeDecl, "RefStructs"); |
|
|
|
|
} |
|
|
|
|
if (settings.RequiredMembers) |
|
|
|
|
{ |
|
|
|
@ -1851,6 +1852,30 @@ namespace ICSharpCode.Decompiler.CSharp
@@ -1851,6 +1852,30 @@ namespace ICSharpCode.Decompiler.CSharp
|
|
|
|
|
return found; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
internal static bool RemoveCompilerFeatureRequiredAttribute(EntityDeclaration entityDecl, string feature) |
|
|
|
|
{ |
|
|
|
|
bool found = false; |
|
|
|
|
foreach (var section in entityDecl.Attributes) |
|
|
|
|
{ |
|
|
|
|
foreach (var attr in section.Attributes) |
|
|
|
|
{ |
|
|
|
|
var symbol = attr.Type.GetSymbol(); |
|
|
|
|
if (symbol is ITypeDefinition td && td.FullTypeName == KnownAttribute.CompilerFeatureRequired.GetTypeName() |
|
|
|
|
&& attr.Arguments.Count == 1 && attr.Arguments.SingleOrDefault() is PrimitiveExpression pe |
|
|
|
|
&& pe.Value is string s && s == feature) |
|
|
|
|
{ |
|
|
|
|
attr.Remove(); |
|
|
|
|
found = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (section.Attributes.Count == 0) |
|
|
|
|
{ |
|
|
|
|
section.Remove(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return found; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool FindAttribute(EntityDeclaration entityDecl, KnownAttribute attributeType, out Syntax.Attribute attribute) |
|
|
|
|
{ |
|
|
|
|
attribute = null; |
|
|
|
|