Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / gtest-213.cs
1 public interface SomeInterface
2 {
3         int Foo { get; set; }
4 }
5
6 public struct SomeStruct : SomeInterface
7 {
8         int x;
9         public int Foo {
10                 get { return x; }
11                 set { x = value; }
12         }
13 }
14
15 public class Test
16 {
17         public static void Fun<T> (T t)
18                 where T : SomeInterface
19         {
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'");
24         }
25
26         public static void Main()
27         {
28                 Fun (new SomeStruct ());
29         }
30 }