2010-05-31 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / gtest-242.cs
blobb1b5319ae7af949a9ebefefdb1a6d0861bf09781
1 // #77358
2 using System;
4 public class Container<T>
5 where T : IComparable<T>
9 public class ReferenceType : IComparable<ReferenceType>
11 public int value;
13 public int CompareTo (ReferenceType obj)
15 return 0;
19 public struct MyValueType : IComparable<MyValueType>
21 public int value;
23 public int CompareTo (MyValueType obj)
25 return 0;
29 public class Test
31 public static void Main ()
33 // Compilation succeeds, constraint satisfied
34 new Container<ReferenceType> ();
36 // Compilation fails, constraint not satisfied according to mcs,
37 // the unmodified testcase compiles successfully with csc
38 new Container<MyValueType> ();