Skip to content

Instantly share code, notes, and snippets.

@adamralph
Created January 9, 2016 21:48
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 adamralph/23c573f809fa48bb4c0d to your computer and use it in GitHub Desktop.
Save adamralph/23c573f809fa48bb4c0d to your computer and use it in GitHub Desktop.
[Fact]
public async Task SillyTest()
{
var foo = await Foo();
var task = SomeMockMethodOrWhateverWhichReturnsATaskWhichNeverCompletes();
return task;
}
@distantcam
Copy link

This won't even compile. You'll get a CS1997 error which is very undocumented.

CS1997 Since 'SillyTest()' is an async method that returns 'Task', a return keyword must not be followed by an object expression. Did you intent to return 'Task<T>'?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment