Extension methods with generics
问题 I was looking at this question and i was curious why this deosn't compile. Given this code, can anyone explain why the call to IBase.Test() doesn't resolve to the correct extension method? public interface IBase { } public interface IChildA : IBase { } public interface IChildB : IBase { } public static class BaseExtensions { public static IBase Test(this IBase self) { return self; } public static T Test<T>(this T self) where T : IChildB { return self; } } public static class TestClass {