[runtime] Fix monitor exception throwing
[mono.git] / mcs / tools / linker / Tests / TestCases / Linker / Generics / Library.cs
1 using System;
2
3 public class Foo {
4
5         void Bar ()
6         {
7                 int i = 42;
8                 string s = "hey";
9
10                 Baz<int> bi = new Baz<int> (i);
11                 bi.Gazonk ();
12                 bi.Bat<string>(i, s);
13
14                 Baz<string> bs = new Baz<string> (s);
15                 bs.Gazonk ();
16                 bs.Bat<int>(s, i);
17                 bs.BiroBiro ();
18
19                 bs.Blam<Bang> ();
20         }
21 }
22
23 public class Baz<T> {
24
25         T _t;
26
27         public Baz (T t)
28         {
29                 _t = t;
30         }
31
32         public void Gazonk ()
33         {
34                 Console.WriteLine (_t);
35         }
36
37         public void Bat<M> (T t, M m)
38         {
39                 Console.WriteLine ("{0}{1}", t, m);
40         }
41
42         public void Blam<M> ()
43         {
44         }
45
46         public T [] BiroBiro ()
47         {
48                 return new T [0];
49         }
50 }
51
52 class Bang {
53
54         [NotLinked] public Bang ()
55         {
56         }
57 }
58
59 [NotLinked, AttributeUsage (AttributeTargets.All)]
60 public class NotLinkedAttribute : Attribute {
61 }