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>2016-05-31 19:37:01 +0300
committerMarek Safar <marek.safar@gmail.com>2016-05-31 19:40:50 +0300
commitb12385e9fdedd5b146d00a56687c886a647e1865 (patch)
treea47619cd6e40f340abefbe59c9724370dc1ecfea /mcs/tests/test-935.cs
parent65b46a6eafddd3f0e27200600915721ab759fe68 (diff)
[mcs] Add more of undocumented C#6 improved overload resolution
Diffstat (limited to 'mcs/tests/test-935.cs')
-rw-r--r--mcs/tests/test-935.cs74
1 files changed, 74 insertions, 0 deletions
diff --git a/mcs/tests/test-935.cs b/mcs/tests/test-935.cs
new file mode 100644
index 00000000000..c47d89dc628
--- /dev/null
+++ b/mcs/tests/test-935.cs
@@ -0,0 +1,74 @@
+using System;
+using System.Threading.Tasks;
+using System.Linq.Expressions;
+
+public static class Program
+{
+ public delegate void DelegateVoid (int arg);
+ public delegate int DelegateInt (string arg);
+
+ public static int Main ()
+ {
+ Foo (Bar);
+
+ TT (null);
+ NN (0);
+ NN2 (1);
+ Complex (null);
+ return 0;
+ }
+
+ static void TT (Task<string> a)
+ {
+ }
+
+ static void TT (Task<object> b)
+ {
+ throw new ApplicationException ("wrong overload");
+ }
+
+ static void NN (sbyte a)
+ {
+ }
+
+ static void NN (uint? b)
+ {
+ throw new ApplicationException ("wrong overload");
+ }
+
+ static void NN2 (sbyte? a)
+ {
+ }
+
+ static void NN2 (uint? b)
+ {
+ throw new ApplicationException ("wrong overload");
+ }
+
+ public static void Bar (int arg)
+ {
+ }
+
+ public static int Bar (string arg)
+ {
+ return 2;
+ }
+
+ public static void Foo (DelegateVoid input)
+ {
+ throw new ApplicationException ("wrong overload");
+ }
+
+ public static void Foo (DelegateInt input)
+ {
+ }
+
+ static void Complex (Expression<Func<Task<short>>> arg)
+ {
+ }
+
+ static void Complex (Expression<Func<Task<ulong>>> arg)
+ {
+ throw new ApplicationException ("wrong overload");
+ }
+} \ No newline at end of file