blob: ac2df1fa2eb4bbcb9d90680b70f0cbb85edf192d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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);
}
}
|