Mega Code Archive

 
Categories / C# / Generics
 

The overriding method cannot change the inherited constraints

using System; public class MyClass {     public virtual void MethodA<T>(T arg)         where T : new() {     } } public class YClass : MyClass {     public override void MethodA<T>(T arg) {         T obj = new T();     } }