Browse Source

Add pretty tests for static abstract checked and shift operators

Static abstract interface members had no checked operator or
unsigned-right-shift coverage, and static abstract property getters
were never read as rvalues through the constraint.

Assisted-by: Claude:claude-fable-5:Claude Code
pull/3857/head
Siegfried Pammer 3 days ago committed by Siegfried Pammer
parent
commit
9674e0982d
  1. 34
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/StaticAbstractInterfaceMembers.cs

34
ICSharpCode.Decompiler.Tests/TestCases/Pretty/StaticAbstractInterfaceMembers.cs

@ -223,4 +223,38 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty.StaticAbstractInterfaceM
++t; ++t;
} }
} }
#if CS110
internal class ZZCheckedAndShiftOperatorTest
{
public interface IShifty<T> where T : IShifty<T>
{
static abstract T operator +(T l, T r);
static abstract T operator checked +(T l, T r);
static abstract T operator >>>(T l, int r);
}
public static T Add<T>(T a, T b) where T : IShifty<T>
{
return a + b;
}
public static T AddChecked<T>(T a, T b) where T : IShifty<T>
{
return checked(a + b);
}
public static T Shift<T>(T a) where T : IShifty<T>
{
return a >>> 3;
}
public static int UsePropertiesAsRValue<T>() where T : IAmSimple
{
return T.Capacity + T.Count;
}
}
#endif
} }

Loading…
Cancel
Save