|
|
|
@ -354,6 +354,17 @@ namespace ICSharpCode.Decompiler.CSharp
@@ -354,6 +354,17 @@ namespace ICSharpCode.Decompiler.CSharp
|
|
|
|
|
&& IsRecordType(method.Parameters[0].Type); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private bool IsAllowedAttribute(IAttribute attribute) |
|
|
|
|
{ |
|
|
|
|
switch (attribute.AttributeType.ReflectionName) |
|
|
|
|
{ |
|
|
|
|
case "System.Runtime.CompilerServices.CompilerGeneratedAttribute": |
|
|
|
|
return true; |
|
|
|
|
default: |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private bool IsGeneratedCopyConstructor(IMethod method) |
|
|
|
|
{ |
|
|
|
|
/* |
|
|
|
@ -362,7 +373,7 @@ namespace ICSharpCode.Decompiler.CSharp
@@ -362,7 +373,7 @@ namespace ICSharpCode.Decompiler.CSharp
|
|
|
|
|
leave IL_0000 (nop) |
|
|
|
|
*/ |
|
|
|
|
Debug.Assert(method.IsConstructor && method.Parameters.Count == 1); |
|
|
|
|
if (method.GetAttributes().Any() || method.GetReturnTypeAttributes().Any()) |
|
|
|
|
if (method.GetAttributes().Any(attr => !IsAllowedAttribute(attr)) || method.GetReturnTypeAttributes().Any()) |
|
|
|
|
return false; |
|
|
|
|
if (method.Accessibility != Accessibility.Protected && (!isSealed || method.Accessibility != Accessibility.Private)) |
|
|
|
|
return false; |
|
|
|
@ -461,7 +472,7 @@ namespace ICSharpCode.Decompiler.CSharp
@@ -461,7 +472,7 @@ namespace ICSharpCode.Decompiler.CSharp
|
|
|
|
|
return false; |
|
|
|
|
if (!isSealed && !method.IsOverridable) |
|
|
|
|
return false; |
|
|
|
|
if (method.GetAttributes().Any() || method.GetReturnTypeAttributes().Any()) |
|
|
|
|
if (method.GetAttributes().Any(attr => !IsAllowedAttribute(attr)) || method.GetReturnTypeAttributes().Any()) |
|
|
|
|
return false; |
|
|
|
|
if (method.Accessibility != Accessibility.Protected && (!isSealed || method.Accessibility != Accessibility.Private)) |
|
|
|
|
return false; |
|
|
|
@ -637,7 +648,7 @@ namespace ICSharpCode.Decompiler.CSharp
@@ -637,7 +648,7 @@ namespace ICSharpCode.Decompiler.CSharp
|
|
|
|
|
return false; |
|
|
|
|
if (method.IsSealed) |
|
|
|
|
return false; |
|
|
|
|
if (method.GetAttributes().Any() || method.GetReturnTypeAttributes().Any()) |
|
|
|
|
if (method.GetAttributes().Any(attr => !IsAllowedAttribute(attr)) || method.GetReturnTypeAttributes().Any()) |
|
|
|
|
return false; |
|
|
|
|
var body = DecompileBody(method); |
|
|
|
|
if (body == null) |
|
|
|
@ -711,7 +722,7 @@ namespace ICSharpCode.Decompiler.CSharp
@@ -711,7 +722,7 @@ namespace ICSharpCode.Decompiler.CSharp
|
|
|
|
|
return false; |
|
|
|
|
if (!isSealed && !method.IsOverridable) |
|
|
|
|
return false; |
|
|
|
|
if (method.GetAttributes().Any() || method.GetReturnTypeAttributes().Any()) |
|
|
|
|
if (method.GetAttributes().Any(attr => !IsAllowedAttribute(attr)) || method.GetReturnTypeAttributes().Any()) |
|
|
|
|
return false; |
|
|
|
|
if (orderedMembers == null) |
|
|
|
|
return false; |
|
|
|
@ -901,7 +912,7 @@ namespace ICSharpCode.Decompiler.CSharp
@@ -901,7 +912,7 @@ namespace ICSharpCode.Decompiler.CSharp
|
|
|
|
|
return false; |
|
|
|
|
if (!method.IsOverride || method.IsSealed) |
|
|
|
|
return false; |
|
|
|
|
if (method.GetAttributes().Any() || method.GetReturnTypeAttributes().Any()) |
|
|
|
|
if (method.GetAttributes().Any(attr => !IsAllowedAttribute(attr)) || method.GetReturnTypeAttributes().Any()) |
|
|
|
|
return false; |
|
|
|
|
if (orderedMembers == null) |
|
|
|
|
return false; |
|
|
|
|