I know we can't have extension method in nested classes and the reasons behind that choice makes perfect sense, I'm not here to talk about this case.
Is there a design reason why it's impossible to have an extension method in a class that is nested in a static class
?
public static class MyClass1
{
public static class MyClass2
{
public static int Add(this int a, int b) //Doesn't compile
{
return a + b;
}
}
}
Is it just because it's a "corner case" that required more work and was considered useless? Or is there another design reason behind this?