Author: marek
Date: 2008-02-05 09:03:12 -0500 (Tue, 05 Feb 2008)
New Revision: 94882
Added:
trunk/mcs/tests/gtest-anon-21.cs
trunk/mcs/tests/gtest-anon-22.cs
Log:
New tests.
Added: trunk/mcs/tests/gtest-anon-21.cs
===================================================================
--- trunk/mcs/tests/gtest-anon-21.cs 2008-02-05 14:01:47 UTC (rev 94881)
+++ trunk/mcs/tests/gtest-anon-21.cs 2008-02-05 14:03:12 UTC (rev 94882)
@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+
+internal delegate void EmptyDelegate ();
+
+class BaseObject
+{
+ public static int Main ()
+ {
+ int? i;
+ Query <BaseObject> (out i);
+ return 0;
+ }
+
+ static void Closure (EmptyDelegate x)
+ {
+ }
+
+ static List<T> Query<T> (out int? count) where T : BaseObject
+ {
+ count = 0;
+ List<T> results = new List<T> ();
+ Closure (delegate {
+ results.Add (MakeSomething<T> ());
+ });
+ return results;
+ }
+
+ static T MakeSomething<T> () where T : BaseObject
+ {
+ return null;
+ }
+}
+
Property changes on: trunk/mcs/tests/gtest-anon-21.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Added: trunk/mcs/tests/gtest-anon-22.cs
===================================================================
--- trunk/mcs/tests/gtest-anon-22.cs 2008-02-05 14:01:47 UTC (rev 94881)
+++ trunk/mcs/tests/gtest-anon-22.cs 2008-02-05 14:03:12 UTC (rev 94882)
@@ -0,0 +1,37 @@
+using System.Linq.Expressions;
+
+delegate int D1 ();
+delegate long D2 ();
+
+class C
+{
+ static int Foo (D1 d)
+ {
+ return 1;
+ }
+
+ static int Foo (D2 d)
+ {
+ return 2;
+ }
+
+ static int FooE (Expression<D1> d)
+ {
+ return 1;
+ }
+
+ static int FooE (Expression<D2> d)
+ {
+ return 2;
+ }
+
+ public static int Main ()
+ {
+ if (Foo (delegate () { return 1; }) != 1)
+ return 1;
+
+ FooE (() => 1);
+
+ return 0;
+ }
+}
Property changes on: trunk/mcs/tests/gtest-anon-22.cs
___________________________________________________________________
Name: svn:eol-style
+ native
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches