|
|
|
@ -594,7 +594,7 @@ namespace ICSharpCode.Decompiler.Ast
@@ -594,7 +594,7 @@ namespace ICSharpCode.Decompiler.Ast
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
MethodDeclaration CreateMethod(MethodDefinition methodDef) |
|
|
|
|
AttributedNode CreateMethod(MethodDefinition methodDef) |
|
|
|
|
{ |
|
|
|
|
MethodDeclaration astMethod = new MethodDeclaration(); |
|
|
|
|
astMethod.AddAnnotation(methodDef); |
|
|
|
@ -618,6 +618,22 @@ namespace ICSharpCode.Decompiler.Ast
@@ -618,6 +618,22 @@ namespace ICSharpCode.Decompiler.Ast
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Convert MethodDeclaration to OperatorDeclaration if possible
|
|
|
|
|
if (methodDef.IsSpecialName && !methodDef.HasGenericParameters) { |
|
|
|
|
OperatorType? opType = OperatorDeclaration.GetOperatorType(methodDef.Name); |
|
|
|
|
if (opType.HasValue) { |
|
|
|
|
OperatorDeclaration op = new OperatorDeclaration(); |
|
|
|
|
op.CopyAnnotationsFrom(astMethod); |
|
|
|
|
op.ReturnType = astMethod.ReturnType.Detach(); |
|
|
|
|
op.OperatorType = opType.Value; |
|
|
|
|
op.Modifiers = astMethod.Modifiers; |
|
|
|
|
astMethod.Parameters.MoveTo(op.Parameters); |
|
|
|
|
astMethod.Attributes.MoveTo(op.Attributes); |
|
|
|
|
op.Body = astMethod.Body.Detach(); |
|
|
|
|
return op; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return astMethod; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|