Allow extension methods returning local types
As per the "allow extension snippets" suggestion, extension snippets are now permitted. However, these do not work if they reference a local type.
Example:
void Main()
{
new Local().AddFoo().Dump();
}
public class Local {}
public static class Extensions
{
// The type or namespace name 'Local' could not be found
public static string AddFoo(this Local local)
{
return local.ToString() + "Foo";
}
}
2
votes
Bill Sorensen
shared this idea
This is now fixed.
-
Bill Sorensen commented
It would be more correct to say "referencing local types". It doesn't matter if they return them or use them as parameters.