Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / gtest-242.cs
1 // #77358
2 using System;
3
4 public class Container<T>
5         where T : IComparable<T>
6 {
7 }
8
9 public class ReferenceType : IComparable<ReferenceType>
10 {
11         public int value;
12
13         public int CompareTo (ReferenceType obj)
14         {
15                 return 0;
16         }
17 };
18
19 public struct MyValueType : IComparable<MyValueType>
20 {
21         public int value;
22
23         public int CompareTo (MyValueType obj)
24         {
25                 return 0;
26         }
27 };
28
29 public class Test
30 {
31         public static void Main ()
32         {
33                 // Compilation succeeds, constraint satisfied
34                 new Container<ReferenceType> ();
35
36                 // Compilation fails, constraint not satisfied according to mcs,
37                 // the unmodified testcase compiles successfully with csc
38                 new Container<MyValueType> ();
39         }
40 };