Skip to content

Instantly share code, notes, and snippets.

@scionwest
Created October 8, 2018 05:04
Show Gist options
  • Save scionwest/c11579fabb84889e04beed6a29454769 to your computer and use it in GitHub Desktop.
Save scionwest/c11579fabb84889e04beed6a29454769 to your computer and use it in GitHub Desktop.
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Threading.Tasks;
namespace FuncContravarianceIssue
{
[TestClass]
public class UnitTest1
{
private class Foo
{
}
[TestMethod]
public async Task TestMethod1()
{
var data = new Foo();
Task continuationCallback(Task input, Foo state)
{
return Task.CompletedTask;
}
await Task.Delay(1).ContinueWith<Task>(
continuationFunction: continuationCallback,
state: data);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment