diff --git a/BeefLibs/corlib/src/Attribute.bf b/BeefLibs/corlib/src/Attribute.bf index b27ec31a..5d5fac7d 100644 --- a/BeefLibs/corlib/src/Attribute.bf +++ b/BeefLibs/corlib/src/Attribute.bf @@ -375,7 +375,7 @@ namespace System { } - [AttributeUsage(.Method | .Constructor | .Class | .Struct | .Alias)] + [AttributeUsage(.Method | .Constructor | .Class | .Struct | .Alias | .Interface)] public struct ObsoleteAttribute : Attribute { public this(bool isError) diff --git a/BeefLibs/corlib/src/Double.bf b/BeefLibs/corlib/src/Double.bf index db8a59fa..fb9a48ed 100644 --- a/BeefLibs/corlib/src/Double.bf +++ b/BeefLibs/corlib/src/Double.bf @@ -8,7 +8,8 @@ namespace System using System.Globalization; using System.Diagnostics.Contracts; using System.Diagnostics; - + +#unwarn public struct Double : double, IFloating, ISigned, IFormattable, IHashable, IOpComparable, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable, ICanBeNaN { public const double MinValue = -1.7976931348623157E+308; diff --git a/BeefLibs/corlib/src/Float.bf b/BeefLibs/corlib/src/Float.bf index 07174078..63e7e6a0 100644 --- a/BeefLibs/corlib/src/Float.bf +++ b/BeefLibs/corlib/src/Float.bf @@ -2,6 +2,7 @@ using System.Globalization; namespace System { +#unwarn struct Float : float, IFloating, ISigned, IFormattable, IHashable, IEquatable, IOpComparable, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable, ICanBeNaN { public const float MinValue = (float)-3.40282346638528859e+38; diff --git a/BeefLibs/corlib/src/IComparable.bf b/BeefLibs/corlib/src/IComparable.bf index 1d7f7d77..70d38ec1 100644 --- a/BeefLibs/corlib/src/IComparable.bf +++ b/BeefLibs/corlib/src/IComparable.bf @@ -23,51 +23,61 @@ namespace System { } + [Obsolete("Consider operator constraint such as `where bool : operator T == T`", false)] interface IOpEquals { public static bool operator==(Self val1, Self val2); } + [Obsolete("Consider operator constraint such as `where bool : operator T == T2`", false)] interface IOpEquals { public static bool operator==(Self val1, T val2); } + [Obsolete("Consider operator constraint such as `where int : operator T <=> T`", false)] interface IOpComparable { static int operator<=>(Self lhs, Self rhs); } + [Obsolete("Consider operator constraint such as `where T : operator T + T`", false)] interface IOpAddable { static Self operator+(Self lhs, Self rhs); } + [Obsolete("Consider operator constraint such as `where T : operator T - T`", false)] interface IOpSubtractable { static Self operator-(Self lhs, Self rhs); } + [Obsolete("Consider operator constraint such as `where T : operator T * T`", false)] interface IOpMultiplicable { static Self operator*(Self lhs, Self rhs); } + [Obsolete("Consider operator constraint such as `where T : operator T / T`", false)] interface IOpDividable { static Self operator/(Self lhs, Self rhs); } + [Obsolete("Consider operator constraint such as `where T : operator -T`", false)] interface IOpNegatable { static Self operator-(Self value); } + [Obsolete("Consider operator constraint such as `where T : operator implicit T2`", false)] interface IOpConvertibleTo { static operator T(Self value); } + [Obsolete("Consider operator constraint such as `where T : operator implicit T2`", false)] interface IOpConvertibleFrom { static operator Self(T value); diff --git a/BeefLibs/corlib/src/Int.bf b/BeefLibs/corlib/src/Int.bf index 04a9597d..e408ef5f 100644 --- a/BeefLibs/corlib/src/Int.bf +++ b/BeefLibs/corlib/src/Int.bf @@ -2,6 +2,7 @@ using System; namespace System { +#unwarn struct Int : int, IInteger, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable { public enum ParseError diff --git a/BeefLibs/corlib/src/Int16.bf b/BeefLibs/corlib/src/Int16.bf index 45b6e83e..2e80252f 100644 --- a/BeefLibs/corlib/src/Int16.bf +++ b/BeefLibs/corlib/src/Int16.bf @@ -1,5 +1,6 @@ namespace System { +#unwarn struct Int16 : int16, IInteger, ISigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable { public const int32 MaxValue = 0x7FFF; diff --git a/BeefLibs/corlib/src/Int32.bf b/BeefLibs/corlib/src/Int32.bf index 7302ac3a..dcb2fb4c 100644 --- a/BeefLibs/corlib/src/Int32.bf +++ b/BeefLibs/corlib/src/Int32.bf @@ -2,6 +2,7 @@ using System.Globalization; namespace System { +#unwarn struct Int32 : int32, IInteger, ISigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable { public enum ParseError diff --git a/BeefLibs/corlib/src/Int64.bf b/BeefLibs/corlib/src/Int64.bf index 727391ee..0b35102e 100644 --- a/BeefLibs/corlib/src/Int64.bf +++ b/BeefLibs/corlib/src/Int64.bf @@ -2,6 +2,7 @@ using System.Globalization; namespace System { +#unwarn struct Int64 : int64, IInteger, ISigned, IFormattable, IHashable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable { public enum ParseError diff --git a/BeefLibs/corlib/src/Int8.bf b/BeefLibs/corlib/src/Int8.bf index 5b389b52..455cdc9d 100644 --- a/BeefLibs/corlib/src/Int8.bf +++ b/BeefLibs/corlib/src/Int8.bf @@ -1,5 +1,6 @@ namespace System { +#unwarn struct Int8 : int8, IInteger, ISigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable { public const int32 MaxValue = 0x7F; diff --git a/BeefLibs/corlib/src/String.bf b/BeefLibs/corlib/src/String.bf index 9060aec1..753c112c 100644 --- a/BeefLibs/corlib/src/String.bf +++ b/BeefLibs/corlib/src/String.bf @@ -37,7 +37,7 @@ namespace System } [Ordered] - class String : IHashable, IFormattable, IPrintable, IOpComparable + class String : IHashable, IFormattable, IPrintable { enum CreateFlags { @@ -2705,7 +2705,7 @@ namespace System } } - public struct StringView : Span, IFormattable, IPrintable, IOpEquals, IHashable + public struct StringView : Span, IFormattable, IPrintable, IHashable { public this() { diff --git a/BeefLibs/corlib/src/UInt.bf b/BeefLibs/corlib/src/UInt.bf index fb77c6b4..194d1126 100644 --- a/BeefLibs/corlib/src/UInt.bf +++ b/BeefLibs/corlib/src/UInt.bf @@ -1,5 +1,6 @@ namespace System { +#unwarn struct UInt : uint, IInteger, IUnsigned, IHashable, IOpComparable, IFormattable, IIsNaN, IOpAddable, IOpSubtractable { public enum ParseError diff --git a/BeefLibs/corlib/src/UInt16.bf b/BeefLibs/corlib/src/UInt16.bf index dde13b67..f43d7e43 100644 --- a/BeefLibs/corlib/src/UInt16.bf +++ b/BeefLibs/corlib/src/UInt16.bf @@ -1,5 +1,6 @@ namespace System { +#unwarn struct UInt16 : uint16, IInteger, IUnsigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable { public const uint16 MaxValue = (uint16)0xFFFF; diff --git a/BeefLibs/corlib/src/UInt32.bf b/BeefLibs/corlib/src/UInt32.bf index 57c11ce5..d48dbc41 100644 --- a/BeefLibs/corlib/src/UInt32.bf +++ b/BeefLibs/corlib/src/UInt32.bf @@ -1,5 +1,6 @@ namespace System { +#unwarn struct UInt32 : uint32, IInteger, IUnsigned, IHashable, IOpComparable, IFormattable, IIsNaN, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable { public enum ParseError diff --git a/BeefLibs/corlib/src/UInt64.bf b/BeefLibs/corlib/src/UInt64.bf index 1edd4441..232fe9bd 100644 --- a/BeefLibs/corlib/src/UInt64.bf +++ b/BeefLibs/corlib/src/UInt64.bf @@ -2,6 +2,7 @@ using System.Globalization; namespace System { +#unwarn struct UInt64 : uint64, IInteger, IUnsigned, IHashable, IOpComparable, IIsNaN, IFormattable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable { public const uint64 MaxValue = 0xFFFFFFFFFFFFFFFFUL; diff --git a/BeefLibs/corlib/src/UInt8.bf b/BeefLibs/corlib/src/UInt8.bf index 8a874620..fa4ce52d 100644 --- a/BeefLibs/corlib/src/UInt8.bf +++ b/BeefLibs/corlib/src/UInt8.bf @@ -1,5 +1,6 @@ namespace System { +#unwarn struct UInt8 : uint8, IInteger, IUnsigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable { public const uint8 MaxValue = (uint8)0xFF;