2 using System
.Threading
;
3 using System
.Threading
.Tasks
;
7 public virtual Task
<int> Foo (int value)
9 return Task
.FromResult (value);
12 public virtual Task
<int> Prop { get; set; }
17 public override Task
<int> Prop
{
19 throw new ApplicationException ();
22 throw new ApplicationException ();
26 public override async Task
<int> Foo (int value)
28 return await base.Foo (value) + 1;
31 public async Task
<int> Foo2 (int value)
33 base.Prop
= Task
.FromResult (value);
34 return await base.Prop
;
40 public static int Main()
43 if (b
.Foo (3).Result
!= 4)
46 if (b
.Foo2 (5).Result
!= 5)
49 Console
.WriteLine("ok");