Created
October 13, 2018 23:12
-
-
Save martindevans/7858ed1e3c18624c41b1d52b62f20be1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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