Last time we talked about generic method substitutions which resulted in types being declared with more than one method with identical constructed signatures. After thinking long and hard about this problem, we've come to a conclusion as to how to resolve this issue in the next release.
First, lets recap what we know about the problem.
The following is a general set of categories that can result in this scenario occurring:
// Same class class Base<T> { void Foo(T t); void Foo(int t); } class C : Base<int> { } // Inherited from base class class A { void Foo(int i) { } } class B<T> : A { void Foo(T t) { } } class C : B<int> { } // Outer class class A<T> { private void Foo(T t) { } private void Foo(int i) { } class C : A<int> { } } // Outer class and its base class class A<T> { public void Foo(T t) { } } class B<T> : A<T> { private void Foo(int i) { } class C : B<int> { } }
Given the above points, we've decided to take the following action:
This behavior will make it into the next release of the compiler. Until then, don't write code like this if you want it to work! Stay tuned for my investigations on the C# Compiler and modopts!
Welcome to the forty-first Community Convergence. The big news this week is that we have moved Future
Quel sera le résultat du code suivant : class Program { static void Main( string [] args) { B b = new