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:
parent
805d312c98
commit
be0733d37c
6 changed files with 81 additions and 25 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue