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

Improved pointer generic constraints

This commit is contained in:
Brian Fiete 2025-03-21 11:37:26 -04:00
parent 0bdaa03545
commit 195463cb77
3 changed files with 27 additions and 9 deletions

View file

@ -199,6 +199,11 @@ namespace Tests
delete val2;
}
public static int IntPtrTest<T>(T val) where T : int*
{
return *val;
}
public class ClassE
{
public static Self Instance = new ClassE() ~ delete _;
@ -513,6 +518,9 @@ namespace Tests
var innerC = OuterA<int, float>.InnerC.this<int32>(123);
Test.Assert(innerC.mVal == 123);
int iVal = 123;
Test.Assert(IntPtrTest(&iVal) == 123);
}
}