Author: marek
Date: 2006-11-18 18:05:18 -0500 (Sat, 18 Nov 2006)
New Revision: 68138

Added:
   trunk/mcs/errors/cs0123-2.cs
   trunk/mcs/errors/cs0410.cs
   trunk/mcs/tests/test-538.cs
Modified:
   trunk/mcs/errors/cs0123.cs
Log:
New tests.

Added: trunk/mcs/errors/cs0123-2.cs
===================================================================
--- trunk/mcs/errors/cs0123-2.cs        2006-11-18 22:46:52 UTC (rev 68137)
+++ trunk/mcs/errors/cs0123-2.cs        2006-11-18 23:05:18 UTC (rev 68138)
@@ -0,0 +1,20 @@
+// CS0123: The method `MainClass.Delegate()' parameters do not match delegate 
`IA TestDelegate(bool)' parameters
+// Line: 17
+
+delegate IA TestDelegate(bool b);
+
+interface IA {}
+
+public class MainClass : IA
+{
+       static MainClass Delegate()
+       {
+               return null;
+       }
+
+       public static void Main()
+       {
+               TestDelegate delegateInstance = new TestDelegate (Delegate);
+       }
+}
+

Modified: trunk/mcs/errors/cs0123.cs
===================================================================
--- trunk/mcs/errors/cs0123.cs  2006-11-18 22:46:52 UTC (rev 68137)
+++ trunk/mcs/errors/cs0123.cs  2006-11-18 23:05:18 UTC (rev 68138)
@@ -1,4 +1,4 @@
-// cs0123.cs: Method `int MainClass.Delegate()' does not match delegate `int 
TestDelegate(bool)'
+// CS0123: The method `MainClass.Delegate()' parameters do not match delegate 
`int TestDelegate(bool)' parameters
 // Line: 12
 
 delegate int TestDelegate(bool b);

Added: trunk/mcs/errors/cs0410.cs
===================================================================
--- trunk/mcs/errors/cs0410.cs  2006-11-18 22:46:52 UTC (rev 68137)
+++ trunk/mcs/errors/cs0410.cs  2006-11-18 23:05:18 UTC (rev 68138)
@@ -0,0 +1,21 @@
+// CS0410: The method `MainClass MainClass.Delegate()' parameters and return 
type must be same as delegate `IA TestDelegate()' parameters and return type
+// Line: 18
+// Compiler options: -langversion:ISO-1
+
+delegate IA TestDelegate();
+
+interface IA {}
+
+public class MainClass : IA
+{
+       static MainClass Delegate()
+       {
+               return null;
+       }
+
+       public static void Main()
+       {
+               TestDelegate delegateInstance = new TestDelegate (Delegate);
+       }
+}
+

Added: trunk/mcs/tests/test-538.cs
===================================================================
--- trunk/mcs/tests/test-538.cs 2006-11-18 22:46:52 UTC (rev 68137)
+++ trunk/mcs/tests/test-538.cs 2006-11-18 23:05:18 UTC (rev 68138)
@@ -0,0 +1,18 @@
+delegate IInterface testDelegate(concrete x);
+
+interface IInterface {
+}
+
+class concrete : IInterface {
+}
+
+class Program {
+   private concrete getConcrete(IInterface z) {
+      return new concrete();
+   }
+   
+   public static void Main(string[] args) {
+      Program p = new Program();
+      testDelegate x = new testDelegate(p.getConcrete);
+   }
+}
\ No newline at end of file

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to