[mcs] Initial by ref returns and variables support
[mono.git] / mcs / errors / cs8178.cs
1 // CS8178: `await' cannot be used in an expression containing a call to `X.Wrap(int)' because it returns by reference
2 // Line: 12
3
4 using System.Threading.Tasks;
5
6 class X
7 {
8         int x;
9
10         async Task Test ()
11         {
12                 Foo (ref Wrap (await Task.FromResult (1))) = 4;
13         }
14
15         ref int Wrap (int arg)
16         {
17                 return ref x;
18         }
19
20         static ref int Foo (ref int arg)
21         {
22                 return ref arg;
23         }
24 }