Created
August 30, 2013 19:37
-
-
Save migueldeicaza/6393501 to your computer and use it in GitHub Desktop.
This file contains 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.Threading.Tasks; | |
using System.Threading; | |
using System; | |
class X { | |
static void Main () | |
{ | |
var x = new X (); | |
x.Run (); | |
Thread.Sleep (6000); | |
} | |
Task<int> AnimateAsync (Action callback) | |
{ | |
callback (); | |
return null; | |
} | |
void SecondLevel (Action callback) | |
{ | |
callback (); | |
} | |
async void Run () | |
{ | |
var ret = await AnimateAsync (() => { | |
SecondLevel (() => { | |
// This throws System.ArgumentException: Value does not fall within the expected range. | |
Console.WriteLine (this); | |
}); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment