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

Tuples comparison question #1822

Open
greenozon opened this issue Nov 26, 2019 · 1 comment
Open

Tuples comparison question #1822

greenozon opened this issue Nov 26, 2019 · 1 comment
Labels
C# Decompiler The decompiler engine itself New Feature

Comments

@greenozon
Copy link

Just gave a try to some new features like tuple comparison

input code was a singleliner like

return tup1 != tup2 && tup2 == (tup1.a + tup1.b, 0);

output looks very interesting, eg as per ILSpy version 6.0.0.5404-alpha1

private bool CompTuples1((int a, int b) tup1, (int a, int b) tup2)
	{
		(int, int) valueTuple = tup1;
		(int, int) valueTuple2 = tup2;
		int result;
		if (valueTuple.Item1 != valueTuple2.Item1 || valueTuple.Item2 != valueTuple2.Item2)
		{
			valueTuple2 = tup2;
			int num = tup1.a + tup1.b;
			result = ((valueTuple2.Item1 == num && valueTuple2.Item2 == 0) ? 1 : 0);
		}
		else
		{
			result = 0;
		}
		return (byte)result != 0;
	}

Expectation: more user friendly tuple support :)

ILSPY_testa1.zip

@siegfriedpammer siegfriedpammer added C# Decompiler The decompiler engine itself New Feature labels Dec 1, 2019
@dgrunwald
Copy link
Member

Please see #829 for the supported language features. Though it doesn't hurt to have issues for the individual features -- I'll add some links to your issues to the description there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# Decompiler The decompiler engine itself New Feature
Projects
None yet
Development

No branches or pull requests

3 participants