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

Fixed some const constraint undef issues

This commit is contained in:
Brian Fiete 2021-12-31 13:51:08 -05:00
parent f35a3de175
commit 249f4f1016
4 changed files with 58 additions and 18 deletions

View file

@ -265,7 +265,19 @@ namespace Tests
const String cTest0 = Compiler.ReadText("Test0.txt");
const String cTest1 = new String('A', 12);
const uint8[?] cTest0Binary = Compiler.ReadBinary("Test0.txt");
class ClassB<T> where T : const int
{
public typealias TA = comptype(GetVal(10, T));
public const int cTimesTen = 10 * T;
[Comptime]
static Type GetVal(int a, int b)
{
return typeof(float);
}
}
[Test]
public static void TestBasics()
{
@ -311,6 +323,10 @@ namespace Tests
Test.Assert(cTest1 == "AAAAAAAAAAAA");
Test.Assert((Object)cTest1 == (Object)"AAAAAAAAAAAA");
Test.Assert((cTest0Binary[0] == (.)'T') && ((cTest0Binary.Count == 6) || (cTest0Binary.Count == 7)));
ClassB<const 3>.TA f = default;
Test.Assert(typeof(decltype(f)) == typeof(float));
Test.Assert(ClassB<const 3>.cTimesTen == 30);
}
}
}