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

Fixed comptime const evals within comptime

This commit is contained in:
Brian Fiete 2022-02-02 07:27:03 -05:00
parent 1ee32434a5
commit 6c3944170d
5 changed files with 47 additions and 13 deletions

View file

@ -424,6 +424,15 @@ namespace Tests
}
}
[Comptime]
static int GetMixinVal()
{
int a = 23;
Compiler.Mixin("a += 100;");
Compiler.MixinRoot(scope String("b += 200;"));
return a;
}
[Test]
public static void TestBasics()
{
@ -493,6 +502,10 @@ namespace Tests
GetTupleField<decltype(tuple), const 1>.Type tupType1;
Test.Assert(typeof(decltype(tupType0)) == typeof(int16));
Test.Assert(typeof(decltype(tupType1)) == typeof(float));
int b = 34;
Test.Assert(GetMixinVal() == 123);
Test.Assert(b == 234);
}
}
}