C#: Add test cases for static and virtual operators in interfaces and overlapping interface declarations.

This commit is contained in:
Michael Nebel
2023-02-27 16:10:29 +01:00
parent 50570dc3ee
commit 59349ed7c7
2 changed files with 28 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@@ -140,6 +140,33 @@ namespace Test
unsafe public void M1(delegate* unmanaged<System.IntPtr, void> f) => throw null;
}
public interface IInterface2<T> where T : IInterface2<T>
{
static abstract T operator +(T left, T right);
static virtual T operator -(T left, T right) => throw null;
static abstract T operator *(T left, T right);
static virtual T operator /(T left, T right) => throw null;
void M1();
void M2();
}
public interface IInterface3<T> where T : IInterface3<T>
{
static abstract T operator +(T left, T right);
static virtual T operator -(T left, T right) => throw null;
void M1();
}
public class Class11 : IInterface2<Class11>, IInterface3<Class11>
{
public static Class11 operator +(Class11 left, Class11 right) => throw null;
public static Class11 operator -(Class11 left, Class11 right) => throw null;
static Class11 IInterface2<Class11>.operator *(Class11 left, Class11 right) => throw null;
static Class11 IInterface2<Class11>.operator /(Class11 left, Class11 right) => throw null;
public void M1() => throw null;
void IInterface2<Class11>.M2() => throw null;
}
public enum Enum1
{
None1,