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:
parent
662566ed16
commit
f4f10fce99
8 changed files with 155 additions and 66 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue