Skip to content

Instantly share code, notes, and snippets.

@rojepp
Created October 4, 2012 06:40
Show Gist options
  • Save rojepp/3831846 to your computer and use it in GitHub Desktop.
Save rojepp/3831846 to your computer and use it in GitHub Desktop.
Trying to reproduce @voyce's F# bug in C#.
using System;
namespace ConsoleApplication2
{
class Program
{
static DateTime compbugresult;
static void Main(string[] args)
{
compbugresult = compbug.result;
}
}
static class compbug
{
static DateTime randB = System.DateTime.Now;
public static DateTime result;
static compbug()
{
result = System.Threading.Tasks.Task.Run(() => randB).Result;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment