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 generic local functions #1588

Closed
siegfriedpammer opened this issue Jul 18, 2019 · 0 comments · Fixed by #1797
Closed

Support generic local functions #1588

siegfriedpammer opened this issue Jul 18, 2019 · 0 comments · Fixed by #1797
Labels
C# Decompiler The decompiler engine itself Enhancement Areas for improvement

Comments

@siegfriedpammer
Copy link
Member

The support for local functions implemented in #1586 does not cover generic local functions.

A first batch of test cases:

class Program<CT>
{
	public static void Main(string[] args)
	{
		A(args);

		int A<T>(T a)
		{
			return 1;
		}
	}

	public static MT Get<MT>(string key, MT defaultValue)
	{
		return Do();

		MT Do()
		{
			Console.WriteLine(key);
			return defaultValue;
		}
	}

	public static CT TypeParameter()
	{
		return A();

		CT A()
		{
			return default(CT);
		}
	}
}
@siegfriedpammer siegfriedpammer added Decompiler The decompiler engine itself C# Enhancement Areas for improvement labels Jul 18, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2020
ElektroKill added a commit to dnSpyEx/ILSpy that referenced this issue Aug 3, 2021
Add support for generic and static local function

Fixes icsharpcode#1588
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C# Decompiler The decompiler engine itself Enhancement Areas for improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant