1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
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);
MM (1);
MM ((byte) 1);
DecimalRule (() => (byte) 1);
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");
}
static void MM (double f)
{
}
static void MM (double? f)
{
throw new ApplicationException ("wrong overload");
}
static void DecimalRule (Func<int> i)
{
}
static void DecimalRule (Func<decimal?> i)
{
throw new ApplicationException ("wrong overload");
}
}
|