Skip to content

Commit d342697

Browse files
Mark DynamicallyAccessedMemberTypes.All as EditorBrosable(Never) (#117720)
Resolves #114197. `DynamicallyAccessedMemberTypes.All` should be the least used member of this enum, but it is the most popular on all of GitHub. Use of it leads to spurious trimming warnings (because it makes it appear more things are reflected on than needed) and also too much extra size left on the table (for the same reason). Make it harder to discover.
1 parent dec0c3f commit d342697

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/DynamicallyAccessedMemberTypes.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
using System.ComponentModel;
5+
46
namespace System.Diagnostics.CodeAnalysis
57
{
68
/// <summary>
@@ -165,6 +167,7 @@ enum DynamicallyAccessedMemberTypes
165167
/// <summary>
166168
/// Specifies all members.
167169
/// </summary>
170+
[EditorBrowsable(EditorBrowsableState.Never)]
168171
All = ~None
169172
}
170173
}

src/libraries/System.Runtime/ref/System.Runtime.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8894,6 +8894,7 @@ public DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.Dynam
88948894
[System.FlagsAttribute]
88958895
public enum DynamicallyAccessedMemberTypes
88968896
{
8897+
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
88978898
All = -1,
88988899
None = 0,
88998900
PublicParameterlessConstructor = 1,

0 commit comments

Comments
 (0)