Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support VB.NET closure #2192

Closed
CreateAndInject opened this issue Oct 20, 2020 · 1 comment
Closed

Support VB.NET closure #2192

CreateAndInject opened this issue Oct 20, 2020 · 1 comment
Labels
Bug Decompiler The decompiler engine itself

Comments

@CreateAndInject
Copy link
Contributor

    Sub Main()
        Dim words As String() = {"abc", "defgh", "ijklm"}
        Dim word As String = "test"
        Dim count As Integer = words.Count(Function(w) w.Length > word.Length)
        Console.WriteLine(count)
    End Sub

ILSpy:

[STAThread]
public static void Main()
{
	_Closure$__1 closure$__ = new _Closure$__1();
	string[] words = new string[3]
	{
		"abc",
		"defgh",
		"ijklm"
	};
	closure$__.$VB$Local_word = "test";
	string[] source = words;
	object obj;
	int count = source.Count((string w) => w.Length > ((_Closure$__1)obj).$VB$Local_word.Length);
	Console.WriteLine(count);
}

dnSpy:

[STAThread]
public static void Main()
{
	string[] words = new string[]
	{
		"abc",
		"defgh",
		"ijklm"
	};
	string word = "test";
	int count = words.Count((string w) => w.Length > word.Length);
	Console.WriteLine(count);
}
@CreateAndInject CreateAndInject added Bug Decompiler The decompiler engine itself labels Oct 20, 2020
@CreateAndInject
Copy link
Contributor Author

1.zip
@siegfriedpammer There's another VB.NET closure which can't decompile, such as Program.Main LoginForm.smethod_0

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Decompiler The decompiler engine itself
Projects
None yet
Development

No branches or pull requests

1 participant