2010-05-27 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / gtest-398.cs
blob90a45ca38ee2b8127d01b6719c9c55ed69edcd1b
1 using System;
4 public interface IFace
6 void Tst (IFace b);
9 public delegate string ToStr (string format, IFormatProvider format_provider);
12 public class GenericClass<T> where T : IFormattable
14 T field;
16 public GenericClass (T t)
18 this.field = t;
21 public void Method ()
23 ToStr str = new ToStr (field.ToString);
25 Console.WriteLine (str ("x", null));
28 public void Test (T t) { }
33 public class Foo
35 public static void Main (string [] args)
37 GenericClass<int> example = new GenericClass<int> (99);
38 example.Method ();