2010-04-03 Jb Evain <jbevain@novell.com>
[mcs.git] / errors / gcs0309-3.cs
blob7aae4e320a674bdf419d6a025f39ce9b5b7512a7
1 // CS0309: The type `B' must be convertible to `A' in order to use it as parameter `T' in the generic type or method `Foo<T>'
2 // Line: 35
3 using System;
5 public class Foo<T>
6 where T : A
8 public void Test (T t)
10 Console.WriteLine (t);
11 Console.WriteLine (t.GetType ());
12 t.Hello ();
16 public class A
18 public void Hello ()
20 Console.WriteLine ("Hello World");
24 public class B
26 public static implicit operator A (B b)
28 return new A ();
32 class X
34 Foo<B> b;
36 static void Main ()