1
0
Fork 0
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:
Brian Fiete 2025-02-16 11:36:14 -08:00
parent 4b660b2314
commit 421cace017
11 changed files with 203 additions and 59 deletions

View 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);
}
}