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

Fixed delegates with lowered return types

This commit is contained in:
Brian Fiete 2021-07-12 07:55:36 -07:00
parent 5f2d01ac72
commit 401ab0c98e
4 changed files with 40 additions and 12 deletions

View file

@ -114,6 +114,18 @@ namespace Tests
public delegate int DelegateB(T val);
}
[CRepr]
struct Vector3f
{
public float mX;
public float mY;
}
static Vector3f GetVector3f()
{
return .() { mX = 101, mY = 102 };
}
[Test]
public static void TestBasics()
{
@ -167,6 +179,9 @@ namespace Tests
e += new (sender, e) => {};
e += new => LocalEventHandler;
e.Dispose();
delegate Vector3f() vecDlg = scope => GetVector3f;
Test.Assert(vecDlg().mX == 101);
}
public static void Modify(ref int a, ref Splattable b)