1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-17 15:46:05 +02:00

Deprecating IOp* interfaces

This commit is contained in:
Brian Fiete 2020-08-10 13:27:48 -07:00
parent 74382fcb30
commit 99989d5472
15 changed files with 26 additions and 4 deletions

View file

@ -375,7 +375,7 @@ namespace System
{ {
} }
[AttributeUsage(.Method | .Constructor | .Class | .Struct | .Alias)] [AttributeUsage(.Method | .Constructor | .Class | .Struct | .Alias | .Interface)]
public struct ObsoleteAttribute : Attribute public struct ObsoleteAttribute : Attribute
{ {
public this(bool isError) public this(bool isError)

View file

@ -9,6 +9,7 @@ namespace System
using System.Diagnostics.Contracts; using System.Diagnostics.Contracts;
using System.Diagnostics; using System.Diagnostics;
#unwarn
public struct Double : double, IFloating, ISigned, IFormattable, IHashable, IOpComparable, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable, ICanBeNaN public struct Double : double, IFloating, ISigned, IFormattable, IHashable, IOpComparable, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable, ICanBeNaN
{ {
public const double MinValue = -1.7976931348623157E+308; public const double MinValue = -1.7976931348623157E+308;

View file

@ -2,6 +2,7 @@ using System.Globalization;
namespace System namespace System
{ {
#unwarn
struct Float : float, IFloating, ISigned, IFormattable, IHashable, IEquatable<float>, IOpComparable, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable, ICanBeNaN struct Float : float, IFloating, ISigned, IFormattable, IHashable, IEquatable<float>, IOpComparable, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable, ICanBeNaN
{ {
public const float MinValue = (float)-3.40282346638528859e+38; public const float MinValue = (float)-3.40282346638528859e+38;

View file

@ -23,51 +23,61 @@ namespace System
{ {
} }
[Obsolete("Consider operator constraint such as `where bool : operator T == T`", false)]
interface IOpEquals interface IOpEquals
{ {
public static bool operator==(Self val1, Self val2); public static bool operator==(Self val1, Self val2);
} }
[Obsolete("Consider operator constraint such as `where bool : operator T == T2`", false)]
interface IOpEquals<T> interface IOpEquals<T>
{ {
public static bool operator==(Self val1, T val2); public static bool operator==(Self val1, T val2);
} }
[Obsolete("Consider operator constraint such as `where int : operator T <=> T`", false)]
interface IOpComparable interface IOpComparable
{ {
static int operator<=>(Self lhs, Self rhs); static int operator<=>(Self lhs, Self rhs);
} }
[Obsolete("Consider operator constraint such as `where T : operator T + T`", false)]
interface IOpAddable interface IOpAddable
{ {
static Self operator+(Self lhs, Self rhs); static Self operator+(Self lhs, Self rhs);
} }
[Obsolete("Consider operator constraint such as `where T : operator T - T`", false)]
interface IOpSubtractable interface IOpSubtractable
{ {
static Self operator-(Self lhs, Self rhs); static Self operator-(Self lhs, Self rhs);
} }
[Obsolete("Consider operator constraint such as `where T : operator T * T`", false)]
interface IOpMultiplicable interface IOpMultiplicable
{ {
static Self operator*(Self lhs, Self rhs); static Self operator*(Self lhs, Self rhs);
} }
[Obsolete("Consider operator constraint such as `where T : operator T / T`", false)]
interface IOpDividable interface IOpDividable
{ {
static Self operator/(Self lhs, Self rhs); static Self operator/(Self lhs, Self rhs);
} }
[Obsolete("Consider operator constraint such as `where T : operator -T`", false)]
interface IOpNegatable interface IOpNegatable
{ {
static Self operator-(Self value); static Self operator-(Self value);
} }
[Obsolete("Consider operator constraint such as `where T : operator implicit T2`", false)]
interface IOpConvertibleTo<T> interface IOpConvertibleTo<T>
{ {
static operator T(Self value); static operator T(Self value);
} }
[Obsolete("Consider operator constraint such as `where T : operator implicit T2`", false)]
interface IOpConvertibleFrom<T> interface IOpConvertibleFrom<T>
{ {
static operator Self(T value); static operator Self(T value);

View file

@ -2,6 +2,7 @@ using System;
namespace System namespace System
{ {
#unwarn
struct Int : int, IInteger, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable struct Int : int, IInteger, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable
{ {
public enum ParseError public enum ParseError

View file

@ -1,5 +1,6 @@
namespace System namespace System
{ {
#unwarn
struct Int16 : int16, IInteger, ISigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable struct Int16 : int16, IInteger, ISigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable
{ {
public const int32 MaxValue = 0x7FFF; public const int32 MaxValue = 0x7FFF;

View file

@ -2,6 +2,7 @@ using System.Globalization;
namespace System namespace System
{ {
#unwarn
struct Int32 : int32, IInteger, ISigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable struct Int32 : int32, IInteger, ISigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable
{ {
public enum ParseError public enum ParseError

View file

@ -2,6 +2,7 @@ using System.Globalization;
namespace System namespace System
{ {
#unwarn
struct Int64 : int64, IInteger, ISigned, IFormattable, IHashable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable struct Int64 : int64, IInteger, ISigned, IFormattable, IHashable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable
{ {
public enum ParseError public enum ParseError

View file

@ -1,5 +1,6 @@
namespace System namespace System
{ {
#unwarn
struct Int8 : int8, IInteger, ISigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable struct Int8 : int8, IInteger, ISigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable
{ {
public const int32 MaxValue = 0x7F; public const int32 MaxValue = 0x7F;

View file

@ -37,7 +37,7 @@ namespace System
} }
[Ordered] [Ordered]
class String : IHashable, IFormattable, IPrintable, IOpComparable class String : IHashable, IFormattable, IPrintable
{ {
enum CreateFlags enum CreateFlags
{ {
@ -2705,7 +2705,7 @@ namespace System
} }
} }
public struct StringView : Span<char8>, IFormattable, IPrintable, IOpEquals<String>, IHashable public struct StringView : Span<char8>, IFormattable, IPrintable, IHashable
{ {
public this() public this()
{ {

View file

@ -1,5 +1,6 @@
namespace System namespace System
{ {
#unwarn
struct UInt : uint, IInteger, IUnsigned, IHashable, IOpComparable, IFormattable, IIsNaN, IOpAddable, IOpSubtractable struct UInt : uint, IInteger, IUnsigned, IHashable, IOpComparable, IFormattable, IIsNaN, IOpAddable, IOpSubtractable
{ {
public enum ParseError public enum ParseError

View file

@ -1,5 +1,6 @@
namespace System namespace System
{ {
#unwarn
struct UInt16 : uint16, IInteger, IUnsigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable struct UInt16 : uint16, IInteger, IUnsigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable
{ {
public const uint16 MaxValue = (uint16)0xFFFF; public const uint16 MaxValue = (uint16)0xFFFF;

View file

@ -1,5 +1,6 @@
namespace System namespace System
{ {
#unwarn
struct UInt32 : uint32, IInteger, IUnsigned, IHashable, IOpComparable, IFormattable, IIsNaN, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable struct UInt32 : uint32, IInteger, IUnsigned, IHashable, IOpComparable, IFormattable, IIsNaN, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable
{ {
public enum ParseError public enum ParseError

View file

@ -2,6 +2,7 @@ using System.Globalization;
namespace System namespace System
{ {
#unwarn
struct UInt64 : uint64, IInteger, IUnsigned, IHashable, IOpComparable, IIsNaN, IFormattable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable struct UInt64 : uint64, IInteger, IUnsigned, IHashable, IOpComparable, IIsNaN, IFormattable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable
{ {
public const uint64 MaxValue = 0xFFFFFFFFFFFFFFFFUL; public const uint64 MaxValue = 0xFFFFFFFFFFFFFFFFUL;

View file

@ -1,5 +1,6 @@
namespace System namespace System
{ {
#unwarn
struct UInt8 : uint8, IInteger, IUnsigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable struct UInt8 : uint8, IInteger, IUnsigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable
{ {
public const uint8 MaxValue = (uint8)0xFF; public const uint8 MaxValue = (uint8)0xFF;