1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-27 20:18:01 +02:00

Fixed deferred function call

This commit is contained in:
Brian Fiete 2025-03-08 11:02:07 -08:00
parent 805d312c98
commit be0733d37c
6 changed files with 81 additions and 25 deletions

View file

@ -182,6 +182,13 @@ namespace Tests
{
sVal = 123;
}
public static void TestDefer()
{
function void() func = => Func;
if (func != null)
defer:: func.Invoke();
}
}
public static int UseFunc0<T>(function int (T this, float f) func, T a, float b)
@ -254,6 +261,10 @@ namespace Tests
ClassC<Zoop>.Test();
Test.Assert(Zoop.sVal == 123);
Zoop.sVal = 0;
Zoop.TestDefer();
Test.Assert(Zoop.sVal == 123);
}
}
}