Skip to content

Instantly share code, notes, and snippets.

@eldenis
Created October 14, 2015 14:59
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 eldenis/bac4fbc80f581eb36781 to your computer and use it in GitHub Desktop.
Save eldenis/bac4fbc80f581eb36781 to your computer and use it in GitHub Desktop.
Evilest C# Class Ever
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using static System.Console;
namespace ConsoleApplication2
{
class Program
{
static string Str => $"This is the time: {DateTime.Now}";
static async void Print(string str) => await Task.Run(() => WriteLine(str));
static IEnumerable<string> Strings()
{
yield return Str;
yield return nameof(Str);
}
static void Main(string[] args)
{
foreach (var str in Strings())
Print($"{str}");
}
}
}
@eldenis
Copy link
Author

eldenis commented Oct 14, 2015

Why won't this class compile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment