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:
parent
a94b52ff58
commit
b640bf9d5e
8 changed files with 189 additions and 89 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue