static int Main() { IAuditTrail <IRaftLogEntry> auditTrail = new AuditTrail(); // This should not fail per C# specs here: // https://github.com/dotnet/csharplang/blob/master/spec/classes.md#type-parameter-constraints auditTrail.AppendAsync <EmptyLogEntry>(new EmptyLogEntry(), CancellationToken.None); // This should work since int always meets the constraint of IBuggy<T1>.Foo<T2> where T2: T1 ((IBuggy <int>) new Worky()).Foo <int>(); // This should work since Object always meets the constraint of IBuggy<T1>.Foo<T2> where T2: T1 ((IBuggy <object>) new Worky2()).Foo <string>(); // This should not throw since Open meets the constraint of IBuggy<T1>.Foo<T2> where T2: T1 ((IBuggy <Open>) new Buggy()).Foo <Open>(); return(100); }