Skip to content

Instantly share code, notes, and snippets.

@ufcpp
Created October 31, 2019 10:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ufcpp/b04051c896db5485ceab8989d3796635 to your computer and use it in GitHub Desktop.
Save ufcpp/b04051c896db5485ceab8989d3796635 to your computer and use it in GitHub Desktop.
interface いくつまで実装できるのか問題
using System.IO;
static class Program
{
static void Main()
{
var c = new C();
using var f = new StreamWriter(File.OpenWrite("out.cs"));
for (int i = 0; i < 65536; i++)
f.WriteLine($"interface I{i:X} {{ }}");
f.Write("class C : ");
for (int i = 0; i < 65536; i++)
f.Write($"I{i:X}, ");
f.WriteLine("IDisposable { public void Dispose() { } }");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment