Просмотр исходного кода

Update test-86 some more

svn path=/trunk/mcs/; revision=3088
Ravi Pratap M 24 лет назад
Родитель
Сommit
15f7dffd38
2 измененных файлов с 25 добавлено и 3 удалено
  1. 5 0
      mcs/tests/ChangeLog
  2. 20 3
      mcs/tests/test-86.cs

+ 5 - 0
mcs/tests/ChangeLog

@@ -1,3 +1,8 @@
+2002-03-13  Ravi Pratap  <[email protected]>
+
+	* test-86.cs : Add. This is to check for correct overload resolution
+	with a null literal.
+
 2002-03-07  Ravi Pratap  <[email protected]>
 
 	* test-82.cs : Add.

+ 20 - 3
mcs/tests/test-86.cs

@@ -14,15 +14,32 @@ namespace T {
 			Console.WriteLine ("Wrong method called !");
 			return 2;
 		}
+
+		static int method2 (Type t, int val)
+		{
+			Console.WriteLine ("MEthod2 : " + val);
+			return 3;
+		}
+
+		static int method2 (Type t, Type [] types)
+		{
+			Console.WriteLine ("Correct one this time!");
+			return 4;
+		}
 		
 		public static int Main()
 		{
 			int i = method1 (null, 1);
 
-			if (i == 1)
-				return 0;
-			else
+			if (i != 1)
+				return 1;
+			
+			i = method2 (null, null);
+			
+			if (i != 4)
 				return 1;
+			
+			return 0;
 		}
 	}
 }