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

Improve pattern match for generic #2613

Closed
CreateAndInject opened this issue Jan 19, 2022 · 0 comments
Closed

Improve pattern match for generic #2613

CreateAndInject opened this issue Jan 19, 2022 · 0 comments
Labels
Bug Decompiler The decompiler engine itself

Comments

@CreateAndInject
Copy link
Contributor

        static void Test<T>(T a)
        {
            if (a is int x)
                Console.WriteLine(x);
        }

ILSpy:

private static void Test<T>(T a)
{
	if (a is int)
	{
		object obj = a;
		int x = (int)((obj is int) ? obj : null);
		if (true)
		{
			Console.WriteLine(x);
		}
	}
}
@CreateAndInject CreateAndInject added Bug Decompiler The decompiler engine itself labels Jan 19, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2023
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