diff options
author | Marek Safar <marek.safar@gmail.com> | 2008-06-26 22:19:20 +0400 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2008-06-26 22:19:20 +0400 |
commit | c36e1fd4c30cd0bb454a0cc624dc583a40e8307d (patch) | |
tree | 3c0b683cf87615f5c5440d1a8e8732d187570b6e /mcs/tests/gtest-398.cs | |
parent | cc9eb38a79a5195c693a9d0eefd9954028155574 (diff) |
2008-06-26 Marek Safar <marek.safar@gmail.com>
A test for bug #379348
svn path=/trunk/mcs/; revision=106662
Diffstat (limited to 'mcs/tests/gtest-398.cs')
-rwxr-xr-x | mcs/tests/gtest-398.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/mcs/tests/gtest-398.cs b/mcs/tests/gtest-398.cs new file mode 100755 index 00000000000..626c5a7fd90 --- /dev/null +++ b/mcs/tests/gtest-398.cs @@ -0,0 +1,41 @@ +using System;
+
+
+public interface IFace
+{
+ void Tst (IFace b);
+}
+
+public delegate string ToStr (string format, IFormatProvider format_provider);
+
+
+public class GenericClass<T> where T : IFormattable
+{
+ T field;
+
+ public GenericClass (T t)
+ {
+ this.field = t;
+ }
+
+ public void Method ()
+ {
+ ToStr str = new ToStr (field.ToString);
+
+ Console.WriteLine (str ("x", null));
+ }
+
+ public void Test (T t) { }
+}
+
+
+
+public class Foo
+{
+ public static void Main (string [] args)
+ {
+ GenericClass<int> example = new GenericClass<int> (99);
+ example.Method ();
+ }
+}
+
|