1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Deeper binop interface check for generic param

This commit is contained in:
Brian Fiete 2024-09-26 12:33:51 -04:00
parent f8da7eb618
commit bf3dec931a
3 changed files with 44 additions and 0 deletions

View file

@ -413,6 +413,25 @@ namespace Tests
}
}
public interface IAdd
{
static Self operator+(Self a, Self b);
}
public interface IAdd2 : IAdd
{
}
public static void MyFunction<T>(T a, T b) where T : IAdd
{
T sum = a + b;
}
public static void MyFunction2<T>(T a, T b) where T : IAdd2
{
T sum = a + b;
}
[Test]
public static void TestDefaults()
{