diff options
author | Marek Safar <marek.safar@gmail.com> | 2016-05-31 19:37:01 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2016-05-31 19:40:50 +0300 |
commit | b12385e9fdedd5b146d00a56687c886a647e1865 (patch) | |
tree | a47619cd6e40f340abefbe59c9724370dc1ecfea /mcs/tests/test-935.cs | |
parent | 65b46a6eafddd3f0e27200600915721ab759fe68 (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.cs | 74 |
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 |