[mcs] Initial by ref returns and variables support
[mono.git] / mcs / errors / cs8178-2.cs
1 // CS8178: `await' cannot be used in an expression containing a call to `X.this[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 this [await Task.FromResult (1)]);
13         }
14
15         ref int this [int arg] => ref x;
16
17         static void Foo (ref int arg)
18         {
19         }
20 }