1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-21 09:27:59 +02:00

Fixed incorrectly applied method generic constraints in constraint check

This commit is contained in:
Brian Fiete 2025-01-24 10:16:22 -08:00
parent 87405f3387
commit fd24ab21af
2 changed files with 34 additions and 1 deletions

View file

@ -97,6 +97,33 @@ namespace Tests
}
}
public static mixin Test<T>(T a) where T : struct {}
public static mixin Test(Type value) {}
public static mixin Test<T>(T a) where T : class, delete {}
public class TestClass<TValue>
{
public bool CallTest<T>(TValue val)
where TValue : var
{
SelfOuter.Test!(val);
return true;
}
}
public static mixin Test2<T>(T a) where T : struct {}
public static mixin Test2<T>(T a) where T : class, delete {}
public class TestClass2<TValue>
{
public bool CallTest<T>(TValue val)
where TValue : var
{
SelfOuter.Test2!(val);
return true;
}
}
[Test]
public static void TestBasics()
{
@ -130,6 +157,12 @@ namespace Tests
DispClass dc = scope .();
DisposeIt!(dc);
let test2 = scope TestClass<int>();
test2.CallTest<int>(2);
let test3 = scope TestClass2<int>();
test3.CallTest<int>(2);
}
[Test]