1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-16 15:24:10 +02:00

Fixed deferred targeted boxing, DisableChecks, sized array generics

This commit is contained in:
Brian Fiete 2019-11-28 09:11:54 -08:00
parent a94b52ff58
commit b640bf9d5e
8 changed files with 189 additions and 89 deletions

View file

@ -42,4 +42,24 @@ namespace Tests
}
}
class ConstGenerics
{
public static float GetSum<TCount>(float[TCount] vals) where TCount : const int
{
float total = 0;
for (int i < vals.Count)
total += vals[i];
return total;
}
[Test]
public static void TestBasics()
{
float[5] fVals = .(10, 20, 30, 40, 50);
float totals = GetSum(fVals);
Test.Assert(totals == 10+20+30+40+50);
}
}
}