1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Adding Obsolete/Error/Warn attributes, devirt fixes for struct ptr

This commit is contained in:
Brian Fiete 2019-10-09 16:11:49 -07:00
parent 1aded38e36
commit ad2542eba6
4 changed files with 261 additions and 22 deletions

View file

@ -319,7 +319,6 @@ namespace System
{
}
/// Generally used as a per-method optimization, [DisableObjectAccessChecks] will avoid the runtime per-object-access
/// checks which by default are only applied in debug builds anyway.
[AttributeUsage(AttributeTargets.Method/*, AlwaysIncludeTarget=true*/)]
@ -327,6 +326,38 @@ namespace System
{
}
[AttributeUsage(.Method | .Constructor)]
public struct ObsoleteAttribute : Attribute
{
public this(bool isError)
{
}
public this(String error, bool isError)
{
}
}
[AttributeUsage(.Method | .Constructor)]
public struct ErrorAttribute : Attribute
{
public this(String error)
{
}
}
[AttributeUsage(.Method | .Constructor)]
public struct WarnAttribute : Attribute
{
public this(String error)
{
}
}
/// If [NoDiscard] is used on a method, the the compiler will show a warning if the result is discarded.
/// If used on a type, the compiler will show an warning if any method returns that type and the caller discards the result.
[AttributeUsage(.Method | .Class | .Struct)]