2009-03-11 Zoltan Varga <vargaz@gmail.com>
[mcs.git] / tests / gtest-213.cs
blobac49ea85feddce252909a4f77bc20a46e60c24d9
1 public interface SomeInterface
3 int Foo { get; set; }
6 public struct SomeStruct : SomeInterface
8 int x;
9 public int Foo {
10 get { return x; }
11 set { x = value; }
15 public class Test
17 public static void Fun<T> (T t)
18 where T : SomeInterface
20 if (++t.Foo != 1)
21 throw new System.Exception ("not 1");
22 if (t.Foo != 1)
23 throw new System.Exception ("didn't update 't'");
26 static void Main()
28 Fun (new SomeStruct ());