[mcs] Await flow analysis uses resolved expression. Fixes #16840
authorMarek Safar <marek.safar@gmail.com>
Fri, 3 Jan 2014 16:52:03 +0000 (17:52 +0100)
committerMarek Safar <marek.safar@gmail.com>
Sat, 4 Jan 2014 14:33:11 +0000 (15:33 +0100)
mcs/mcs/async.cs
mcs/tests/test-async-57.cs [new file with mode: 0644]

index ca39017696d7a61b6d2b9dc650e7ffb903ff78c6..10cc8c30b789421ddd87893d0afaa84bda8f7a99 100644 (file)
@@ -67,7 +67,7 @@ namespace Mono.CSharp
 
                public override void FlowAnalysis (FlowAnalysisContext fc)
                {
-                       expr.FlowAnalysis (fc);
+                       stmt.Expr.FlowAnalysis (fc);
 
                        stmt.RegisterResumePoint ();
                }
diff --git a/mcs/tests/test-async-57.cs b/mcs/tests/test-async-57.cs
new file mode 100644 (file)
index 0000000..aa7e59e
--- /dev/null
@@ -0,0 +1,16 @@
+using System.Threading.Tasks;
+using System;
+
+class X
+{
+       readonly Func<string, Task> action = null;
+
+       public static void Main ()
+       {
+       }
+
+       protected async Task TestAsync ()
+       {
+               await action ("");
+       }
+}
\ No newline at end of file