Browse Source

Add missing annotations after TranslateFunction

pull/923/head
Siegfried Pammer 8 years ago
parent
commit
c2a7c806f0
  1. 3
      ICSharpCode.Decompiler/CSharp/CallBuilder.cs
  2. 4
      ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs

3
ICSharpCode.Decompiler/CSharp/CallBuilder.cs

@ -323,7 +323,8 @@ namespace ICSharpCode.Decompiler.CSharp @@ -323,7 +323,8 @@ namespace ICSharpCode.Decompiler.CSharp
break;
case OpCode.ILFunction:
method = ((ILFunction)func).Method;
return expressionBuilder.TranslateFunction(inst.Method.DeclaringType, (ILFunction)func);
return expressionBuilder.TranslateFunction(inst.Method.DeclaringType, (ILFunction)func)
.WithILInstruction(inst);
default:
throw new ArgumentException($"Unknown instruction type: {func.OpCode}");
}

4
ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs

@ -1026,7 +1026,7 @@ namespace ICSharpCode.Decompiler.CSharp @@ -1026,7 +1026,7 @@ namespace ICSharpCode.Decompiler.CSharp
return new CallBuilder(this, typeSystem, settings).Build(inst);
}
internal TranslatedExpression TranslateFunction(IType delegateType, ILFunction function)
internal ExpressionWithResolveResult TranslateFunction(IType delegateType, ILFunction function)
{
var method = function.Method.MemberDefinition as IMethod;
Debug.Assert(method != null);
@ -1098,7 +1098,7 @@ namespace ICSharpCode.Decompiler.CSharp @@ -1098,7 +1098,7 @@ namespace ICSharpCode.Decompiler.CSharp
TranslatedExpression translatedLambda = replacement.WithILInstruction(function).WithRR(rr);
return new CastExpression(ConvertType(delegateType), translatedLambda)
.WithoutILInstruction().WithRR(new ConversionResolveResult(delegateType, rr, LambdaConversion.Instance));
.WithRR(new ConversionResolveResult(delegateType, rr, LambdaConversion.Instance));
}
IType InferReturnType(BlockStatement body)

Loading…
Cancel
Save