mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
Fixed comptime static local variables
This commit is contained in:
parent
11ccb876a3
commit
17ca23c9af
3 changed files with 82 additions and 26 deletions
|
@ -573,6 +573,20 @@ namespace Tests
|
|||
}
|
||||
}
|
||||
|
||||
public static int GetLocalVal1()
|
||||
{
|
||||
static int sVal = 100;
|
||||
sVal++;
|
||||
return sVal;
|
||||
}
|
||||
|
||||
[Comptime]
|
||||
public static int GetLocalVal2()
|
||||
{
|
||||
GetLocalVal1();
|
||||
return GetLocalVal1();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void TestBasics()
|
||||
{
|
||||
|
@ -666,6 +680,9 @@ namespace Tests
|
|||
|
||||
const int typeSizes = StructE.GetSizes();
|
||||
Test.Assert(typeSizes == sizeof(StructA) + sizeof(EnumA));
|
||||
|
||||
const int cVal = GetLocalVal2();
|
||||
Test.Assert(cVal == 102);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue