2020-08-04 10:30:25 -07:00
|
|
|
#pragma warning disable 168
|
|
|
|
|
2020-06-21 07:50:37 -07:00
|
|
|
using System;
|
|
|
|
|
2020-08-04 10:30:25 -07:00
|
|
|
namespace System
|
|
|
|
{
|
|
|
|
extension Array1<T>
|
|
|
|
{
|
|
|
|
public static bool operator==(Self lhs, Self rhs) where T : IOpEquals
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-21 07:50:37 -07:00
|
|
|
namespace IDETest
|
|
|
|
{
|
|
|
|
class Generics
|
|
|
|
{
|
2020-08-04 10:30:25 -07:00
|
|
|
|
|
|
|
|
2020-06-21 07:50:37 -07:00
|
|
|
public void Method1<T>(T val) where T : Array
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Method2<T, T2>(T val, T2 val2)
|
|
|
|
{
|
|
|
|
Method1(val2); //FAIL 'T', declared to be 'T2'
|
|
|
|
}
|
2020-08-04 10:30:25 -07:00
|
|
|
|
|
|
|
public void Method3<TFoo>(ref TFoo[] val)
|
|
|
|
{
|
|
|
|
bool eq = val == val; //FAIL Generic argument 'T', declared to be 'TFoo' for 'TFoo[].operator==(TFoo[] lhs, TFoo[] rhs)', must implement 'System.IOpEquals'
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Method4()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2020-06-21 07:50:37 -07:00
|
|
|
}
|
|
|
|
}
|