Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2011-08-16 19:22:53 +0400
committerMarek Safar <marek.safar@gmail.com>2011-08-16 19:24:34 +0400
commitde77bb2e500f7eccd2a3b27770d5d0fe07bc698b (patch)
tree38bbe38fdbcceee5d6c22f6ea88bc7dc8a579a67 /mcs/tests/test-async-21.cs
parentd478b34ecd49b4aff1084e64913a6c6cbe3b425e (diff)
Implement await dynamic type expression
Diffstat (limited to 'mcs/tests/test-async-21.cs')
-rw-r--r--mcs/tests/test-async-21.cs47
1 files changed, 47 insertions, 0 deletions
diff --git a/mcs/tests/test-async-21.cs b/mcs/tests/test-async-21.cs
new file mode 100644
index 00000000000..b45c43b47e9
--- /dev/null
+++ b/mcs/tests/test-async-21.cs
@@ -0,0 +1,47 @@
+// Compiler options: -langversion:future
+
+using System;
+using System.Threading.Tasks;
+
+class S
+{
+ public A GetAwaiter ()
+ {
+ return new A ();
+ }
+}
+
+class A
+{
+ bool IsCompleted {
+ get {
+ return false;
+ }
+ }
+
+ void OnCompleted (System.Action a)
+ {
+ a ();
+ }
+
+ int GetResult ()
+ {
+ return 3;
+ }
+
+ static async Task<int> Test1 ()
+ {
+ dynamic d = new S ();
+ return await d;
+ }
+
+ public static int Main ()
+ {
+ var r = Test1 ();
+ if (!Task.WaitAll (new [] { r }, 1000))
+ return 1;
+
+ Console.WriteLine ("ok");
+ return 0;
+ }
+} \ No newline at end of file