Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Baulig <martin@novell.com>2006-02-08 01:12:43 +0300
committerMartin Baulig <martin@novell.com>2006-02-08 01:12:43 +0300
commit3041318132791aefe0137ea1082bdc52a36c514a (patch)
tree4ea211cef7cf2c840c89c6ff3bea308e84e9fca5 /mcs/tests/gtest-243.cs
parentbba97fc034c5d0f3908e701e00bf778aa87be5fe (diff)
2006-02-07 Martin Baulig <martin@ximian.com>
* generic.cs (TypeManager.IsGenericMethod): We now return whether something is an instantiated generic method (and not a generic method def). (TypeManager.IsGenericMethodDefinition): New public method. * typemanager.cs (TypeManager.CSharpSignature): Only include type arguments for "real" generic methods, not for any instantiated method. (TypeManager.GetMethodName): Likewise, but also allow generic method definitions here. svn path=/trunk/mcs/; revision=56647
Diffstat (limited to 'mcs/tests/gtest-243.cs')
-rwxr-xr-xmcs/tests/gtest-243.cs51
1 files changed, 51 insertions, 0 deletions
diff --git a/mcs/tests/gtest-243.cs b/mcs/tests/gtest-243.cs
new file mode 100755
index 00000000000..8eb70f40d87
--- /dev/null
+++ b/mcs/tests/gtest-243.cs
@@ -0,0 +1,51 @@
+// Bugs #77466 and #77460.
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+
+public class Foo<T>
+{
+ public void Test (T t)
+ { }
+}
+
+public class Tests
+{
+ public static void foo<T> ()
+ {
+ }
+
+ public static int Test ()
+ {
+ MethodInfo mi = typeof (Tests).GetMethod ("foo");
+ if (!mi.IsGenericMethod)
+ return 1;
+ if (!mi.IsGenericMethodDefinition)
+ return 2;
+ MethodInfo mi2 = mi.MakeGenericMethod (new Type[] { typeof (int) });
+ if (!mi2.IsGenericMethod)
+ return 3;
+ if (mi2.IsGenericMethodDefinition)
+ return 4;
+
+ MethodInfo mi3 = typeof (Foo<int>).GetMethod ("Test");
+ if (mi3.IsGenericMethod)
+ return 5;
+ if (mi3.IsGenericMethodDefinition)
+ return 6;
+
+ return 0;
+ }
+
+ public static int Main ()
+ {
+ int result = Test ();
+#if DEBUG
+ if (result == 0)
+ Console.WriteLine ("OK");
+ else
+ Console.WriteLine ("ERROR: {0}", result);
+#endif
+ return result;
+ }
+}