mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-27 20:18:01 +02:00
Expanding support for params
in delegates, params
tuple support
This commit is contained in:
parent
4b660b2314
commit
421cace017
11 changed files with 203 additions and 59 deletions
29
IDEHelper/Tests/src/Params.bf
Normal file
29
IDEHelper/Tests/src/Params.bf
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
|
||||
namespace Tests;
|
||||
|
||||
class Params
|
||||
{
|
||||
class ClassA<T> where T : Tuple
|
||||
{
|
||||
public static int Test(delegate int(char8 a, params T) dlg, params T par)
|
||||
{
|
||||
return dlg('A', params par);
|
||||
}
|
||||
}
|
||||
|
||||
class ClassB : ClassA<(int a, float b)>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public static void TestBasics()
|
||||
{
|
||||
int val = ClassB.Test(scope (a, __a, b) =>
|
||||
{
|
||||
return (.)a + (.)__a + (.)b;
|
||||
}, 10, 2.3f);
|
||||
Test.Assert(val == 65+10+2);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue