Skip to content

Instantly share code, notes, and snippets.

@martindevans
Created October 13, 2018 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martindevans/7858ed1e3c18624c41b1d52b62f20be1 to your computer and use it in GitHub Desktop.
Save martindevans/7858ed1e3c18624c41b1d52b62f20be1 to your computer and use it in GitHub Desktop.
public class Demo
{
public static void DemoIt()
{
var builder = new GenericBuilder<TypeTrue, TypeFalse>();
// builder.Build(); Not valid
var builder2 = new GenericBuilder<TypeTrue, TypeTrue>();
builder2.Build();
}
}
public interface ITypeBool { }
public class TypeTrue : ITypeBool { }
public class TypeFalse : ITypeBool { }
public class GenericBuilder<TA, TB>
{
}
public static class Ext
{
public static void Build<TA, TB>(this GenericBuilder<TA, TB> builder)
where TA: TypeTrue
where TB: TypeTrue
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment