[sgen] Don't trigger collections during allocation of thread objects (#17970)
[mono-project.git] / mcs / errors / cs0311-3.cs
blob06bb4b0c0d222ec40ad638f071016cd104054086
1 // CS0311: The type `B' cannot be used as type parameter `T' in the generic type or method `Foo<T>'. There is no implicit reference conversion from `B' to `A'
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 ()