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:
parent
f8da7eb618
commit
bf3dec931a
3 changed files with 44 additions and 0 deletions
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue