internal override void GenerateMethodBody(TypeCompilationState compilationState, DiagnosticBag diagnostics) { AnonymousTypeManager manager = ((AnonymousTypeTemplateSymbol)this.ContainingType).Manager; SyntheticBoundNodeFactory F = this.CreateBoundNodeFactory(compilationState, diagnostics); // Method body: // // { // return Cb$Eval$( // _BlockArg(args, 0), // ... // _BlockArg(args, N), // ); // } AnonymousTypeTemplateSymbol anonymousType = (AnonymousTypeTemplateSymbol)this.ContainingType; var cbDel = (anonymousType.GetMembers()[0] as AnonymousTypePropertySymbol).BackingField; MethodSymbol invokeMethod = cbDel.Type.GetDelegateType().DelegateInvokeMethod(); MethodSymbol argMethod = DeclaringCompilation.CodeBlockType().GetMembers("_BlockArg").First() as MethodSymbol; BoundExpression paramArr = F.Parameter(_parameters[0]); var args = new BoundExpression[invokeMethod.ParameterCount]; for (int index = 0; index < invokeMethod.ParameterCount; index++) { args[index] = F.StaticCall(manager.CodeblockType, argMethod, paramArr, F.Literal(index)); } BoundExpression retExpression = F.Call(F.Field(F.This(), cbDel), invokeMethod, args); // Final return statement BoundStatement retStatement = F.Return(retExpression); // Create a bound block F.CloseMethod(F.Block(retStatement)); }