Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

40
mcs/tests/gtest-242.cs Normal file
View File

@@ -0,0 +1,40 @@
// #77358
using System;
public class Container<T>
where T : IComparable<T>
{
}
public class ReferenceType : IComparable<ReferenceType>
{
public int value;
public int CompareTo (ReferenceType obj)
{
return 0;
}
};
public struct MyValueType : IComparable<MyValueType>
{
public int value;
public int CompareTo (MyValueType obj)
{
return 0;
}
};
public class Test
{
public static void Main ()
{
// Compilation succeeds, constraint satisfied
new Container<ReferenceType> ();
// Compilation fails, constraint not satisfied according to mcs,
// the unmodified testcase compiles successfully with csc
new Container<MyValueType> ();
}
};