Skip to content

Instantly share code, notes, and snippets.

@migueldeicaza
Created August 30, 2013 19:37
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 migueldeicaza/6393501 to your computer and use it in GitHub Desktop.
Save migueldeicaza/6393501 to your computer and use it in GitHub Desktop.
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