1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

Fixed error messages for methods with extern constraints in variations

This commit is contained in:
Brian Fiete 2020-08-04 10:30:25 -07:00
parent c7393865b4
commit 92d3ab6ca9
3 changed files with 64 additions and 10 deletions

View file

@ -1,9 +1,24 @@
#pragma warning disable 168
using System;
namespace System
{
extension Array1<T>
{
public static bool operator==(Self lhs, Self rhs) where T : IOpEquals
{
return true;
}
}
}
namespace IDETest
{
class Generics
{
public void Method1<T>(T val) where T : Array
{
@ -13,5 +28,15 @@ namespace IDETest
{
Method1(val2); //FAIL 'T', declared to be 'T2'
}
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()
{
}
}
}