using System; public abstract class A { public abstract G Foo () where G : T; public virtual G Foo2 () where G : T { return default (G); } } public class B : A { public override G Foo () { return new G (); } public override G Foo2 () { return base.Foo2 (); } } abstract class A2 { public abstract void Foo () where U : struct, T; } class B2 : A2 { public override void Foo () { } } abstract class A3 { public abstract void Foo () where U : class, T; } class B3 : A3 { public override void Foo () { } } class Program { public static int Main () { var b = new B (); if (b.Foo () == null) return 0; b.Foo2 (); var b2 = new B2 (); b2.Foo (); var b3 = new B3 (); b3.Foo (); return 1; } }