Created
October 4, 2012 06:40
-
-
Save rojepp/3831846 to your computer and use it in GitHub Desktop.
Trying to reproduce @voyce's F# bug in C#.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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