Browse Source

Handle op_Explicit and op_Implicit.

pull/10/head
Daniel Grunwald 15 years ago
parent
commit
3dd9645f53
  1. 13
      ICSharpCode.Decompiler/Ast/Transforms/ReplaceMethodCallsWithOperators.cs

13
ICSharpCode.Decompiler/Ast/Transforms/ReplaceMethodCallsWithOperators.cs

@ -62,6 +62,19 @@ namespace Decompiler.Transforms
); );
return null; return null;
} }
if (methodRef.Name == "op_Explicit" && arguments.Length == 1) {
arguments[0].Remove(); // detach argument
invocationExpression.ReplaceWith(
arguments[0].CastTo(AstBuilder.ConvertType(methodRef.ReturnType, methodRef.MethodReturnType))
.WithAnnotation(methodRef)
);
return null;
}
if (methodRef.Name == "op_Implicit" && arguments.Length == 1) {
arguments[0].Remove(); // detach argument
invocationExpression.ReplaceWith(arguments[0]);
return null;
}
return null; return null;
} }

Loading…
Cancel
Save