1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-22 09:38:01 +02:00

Fix generic binding in generic mixins

This commit is contained in:
Brian Fiete 2022-07-11 09:03:28 -04:00
parent 627b0381f8
commit 51eaa6276f
3 changed files with 47 additions and 4 deletions

View file

@ -84,6 +84,19 @@ namespace Tests
res.Value
}
static mixin DisposeIt<T>(T val) where T : IDisposable
{
val?.Dispose();
}
class DispClass : IDisposable
{
void IDisposable.Dispose()
{
}
}
[Test]
public static void TestBasics()
{
@ -114,6 +127,9 @@ namespace Tests
Dictionary<int, Dictionary<int, int>> test = scope .() {(1,null)};
int val = CircularMixin!(test);
Test.Assert(val == 211);
DispClass dc = scope .();
DisposeIt!(dc);
}
[Test]