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:
parent
cd1e65231e
commit
cf5c969d1f
15 changed files with 243 additions and 99 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue