Plumb method generics through zeroOf too (#37)

This commit is contained in:
Patrick Stevens
2025-06-02 19:47:03 +01:00
committed by GitHub
parent 2b350986d3
commit 3ac37776df
7 changed files with 144 additions and 80 deletions

View File

@@ -26,6 +26,7 @@
<EmbeddedResource Include="sources\WriteLine.cs" />
<EmbeddedResource Include="sources\InstaQuit.cs" />
<EmbeddedResource Include="sources\Threads.cs" />
<EmbeddedResource Include="sources\ResizeArray.cs" />
</ItemGroup>
<ItemGroup>

View File

@@ -0,0 +1,18 @@
using System.Collections.Generic;
using System.Linq;
namespace HelloWorldApp
{
class Program
{
static int Main(string[] args)
{
var l = new List<int>();
l.Add(3);
l.Add(100);
var m = l.Select(x => x.ToString()).ToList();
// 2 + 103 + (1 + 3) = 109
return m.Count + l.Sum() + m.Select(x => x.Length).Sum();
}
}
}