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:
parent
0bdaa03545
commit
195463cb77
3 changed files with 27 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue