[sgen] Don't trigger collections during allocation of thread objects (#17970)
[mono-project.git] / mcs / errors / cs4014-6.cs
blobf3687cdd92996008eda2007bdb1d3a41567f84c7
1 // CS4014: The statement is not awaited and execution of current method continues before the call is completed. Consider using `await' operator
2 // Line: 47
3 // Compiler options: -warnaserror
5 using System;
6 using System.Runtime.CompilerServices;
7 using System.Threading.Tasks;
9 static class S
11 public static A GetAwaiter (this X x)
13 return new A ();
17 class X
19 public X Foo ()
21 return this;
25 class A : INotifyCompletion
27 bool IsCompleted
29 get
31 return true;
35 public void OnCompleted (Action a)
39 int GetResult ()
41 return 3;
44 static async Task Test3 ()
46 X x = new X ();
47 x.Foo ();
48 await x.Foo ();