1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-16 15:24:10 +02:00

Improvements to const string generic arg, literal generic args

This commit is contained in:
Brian Fiete 2022-02-05 09:23:44 -05:00
parent cd1e65231e
commit cf5c969d1f
15 changed files with 243 additions and 99 deletions

View file

@ -409,6 +409,12 @@ namespace Tests
return total;
}
static int CheckString<T>(T str) where T : const String
{
const bool eq = str == "Abc";
return T.Length;
}
[Test]
public static void TestBasics()
{
@ -441,6 +447,11 @@ namespace Tests
Test.Assert(l2.Front[0] == "2");
Test.Assert(l2.Front[1] == "4");
int len = CheckString("Abc");
Test.Assert(len == 3);
len = CheckString<"Abcd">("Abcd");
Test.Assert(len == 4);
}
}
}