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

Partial explicit generic method arguments with ... or ?

This commit is contained in:
Brian Fiete 2022-02-05 13:47:19 -05:00
parent 662566ed16
commit f4f10fce99
8 changed files with 155 additions and 66 deletions

View file

@ -326,6 +326,11 @@ namespace Tests
TestGen(a);
}
public static TOut Conv<TOut, TIn>(TIn val) where TOut : operator explicit TIn
{
return (TOut)val;
}
[Test]
public static void TestBasics()
{
@ -396,6 +401,9 @@ namespace Tests
true
} == false);
MethodG<ClassG, ClassF>();
Test.Assert(Conv<int...>(12.34f) == 12);
Test.Assert(Conv<int,?>(12.34f) == 12);
}
}