Open
Description
Background and motivation
I'm using JetBrains.Annotations as internal classes in my library and since trimmer doesn't know about these attributes they will be preserved in the final build, but since these attributes are only for code annotations I think it would be nice to have some sort of mechanism, allowing you to mark them as safe for trimming.
I suggest adding a TrimmableAttributeAttribute
which we can use to mark custom code annotation attributes and the linker will know that this attribute can be safely trimmed.
API Proposal
namespace System.Diagnostics.CodeAnalysis;
[AttributeUsage(AttributeTargets.Class)]
public sealed class TrimmableAttributeAttribute : Attribute;
API Usage
[AttributeUsage(AttributeTargets.Parameter)]
[TrimmableAttribute]
public class RequireStaticDelegateAttribute : Attribute
{
public bool IsError { get; set; }
}
Alternative Designs
No response
Risks
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status