2009-03-19 Ivan N. Zlatev <contact@i-nz.net>
[mono.git] / mono / tests / generic-marshalbyref.2.cs
1 using System;
2
3 static class Program
4 {
5     static int Main()
6     {
7             DocumentForm<object> browseForm = new DocumentForm<object> ();
8             if (browseForm.DoInit () != 248)
9                     return 1;
10             return 0;
11     }
12 }
13
14 public abstract class EntityBase
15 {
16 }
17
18 public class GenEntity<T> : EntityBase
19 {
20 }
21
22 class DocumentForm<T>
23 {
24         internal int DoInit()
25         {
26                 var g = new Grid1<GenEntity<T>>(123);
27                 var g2 = new Grid2<GenEntity<T>>(123);
28                 return g.num + g2.num;
29         }
30 }
31
32 public class Grid1<TEntity> : MarshalByRefObject
33 {
34         public int num;
35
36         public Grid1 (int i)
37         {
38                 num = i + 1;
39         }
40 }
41
42 public class Grid2<TEntity> : MarshalByRefObject where TEntity : EntityBase, new()
43 {
44         public int num;
45
46         public Grid2 (int i)
47         {
48                 num = i + 1;
49         }
50 }