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>2007-03-23 04:34:01 +0300
committerMartin Baulig <martin@novell.com>2007-03-23 04:34:01 +0300
commit96359da4525100ad9a95d3795e06f65fb8e03346 (patch)
tree81c004f1386ce82b86993cbb432e54aedb369201 /mcs/tests/gtest-321.cs
parent6440f2de85f2bdbec207f70876eab0e86cef4e98 (diff)
2007-03-23 Martin Baulig <martin@ximian.com>
Fix #81158. * decl.cs (MemberCache.AddMembers): Add generic methods both as "Method" and "Method`1". Normally, a cache lookup is done on the "Method" form (ie. without the generic arity), but this one makes lookups on the full form work as well. svn path=/trunk/mcs/; revision=74864
Diffstat (limited to 'mcs/tests/gtest-321.cs')
-rwxr-xr-xmcs/tests/gtest-321.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/mcs/tests/gtest-321.cs b/mcs/tests/gtest-321.cs
new file mode 100755
index 00000000000..ac2df1fa2eb
--- /dev/null
+++ b/mcs/tests/gtest-321.cs
@@ -0,0 +1,31 @@
+// Bug #81158
+using System;
+
+public class App
+{
+ private delegate void TGenericDelegate<T>(string param);
+ public static void Main (string[] args)
+ {
+ App app = new App ();
+ app.Run();
+ }
+
+ public void Run ()
+ {
+ TGenericDelegate<string> del = ADelegate<string>;
+ TestMethod <string> ("a param", ADelegate<string>);
+ TestMethod <string> ("another param", del);
+ }
+
+ private void TestMethod <T> (string param, TGenericDelegate<T> del)
+ {
+ Console.WriteLine ("TestMethod <T> called with param: {0}. Calling a delegate", param);
+ if (del != null)
+ del (param);
+ }
+
+ private void ADelegate <T> (string param)
+ {
+ Console.WriteLine ("ADelegate <T> called with param: {0}", param);
+ }
+}