Todd King

Converter has bug converting action delegates

When the converter goes to convert the following code:

using System;
namespace ANamespace
{
public class AClass
{
public string AMethodWithLambdas(string msg)
{
int i1, i2 = 2, i3 = 1 + 2;
AClass myObj1, myObj2 = new AClass(), myObj3;
Action act1, act2 = () => Console.WriteLine("Hello World"), act3 = AClass.MyAction, act4 = () => { Console.WriteLine("Line1"); Console.WriteLine("Line2"); }, act5, act6 = () => { AClass.MyAction(); }, act7;
Func<string, string> convertString1,
convertString2 = AClass.MyConvertString,
convertString3 = (string input) => input + "FooBar",
convertString4 = (string input) =>
{
string temp = input + "Alpha";
return temp;
};
return convertString2(msg) + convertString3(msg) + convertString4(msg);
}

private static string MyConvertString(string arg)
{
return arg.ToLower();
}

private static void MyAction()
{
Console.WriteLine("I did something!");
}
}
}

It improperly converts act2 to :
act2 As Action = Function() Console.WriteLine("Hello World")
when it should be
act2 As Action = Sub() Console.WriteLine("Hello World")
Problem by Todd King Status: Not Done Comments: 0 Last update: 2013-09-09T22:51:02 by Todd King
0
Displaying items 71 - 71 of 71