Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

50 lines
658 B
C#

// CS4014: The statement is not awaited and execution of current method continues before the call is completed. Consider using `await' operator
// Line: 47
// Compiler options: -warnaserror
using System;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
static class S
{
public static A GetAwaiter (this X x)
{
return new A ();
}
}
class X
{
public X Foo ()
{
return this;
}
}
class A : INotifyCompletion
{
bool IsCompleted
{
get
{
return true;
}
}
public void OnCompleted (Action a)
{
}
int GetResult ()
{
return 3;
}
static async Task Test3 ()
{
X x = new X ();
x.Foo ();
await x.Foo ();
}
}