Skip to content

Cast removal issue with new cast simplifier #57063

@CyrusNajmabadi

Description

@CyrusNajmabadi
         public static DebuggerBrowsableState? GetDebuggerBrowsableState(MemberInfo info)
         {
             CustomAttributeData? debuggerBrowsableAttribute = info.CustomAttributes
                 .SingleOrDefault(a => a.AttributeType == typeof(DebuggerBrowsableAttribute));
             // Enums in attribute constructors are boxed as ints, so cast to int? first.
-            return (DebuggerBrowsableState?)(int?)debuggerBrowsableAttribute?.ConstructorArguments.Single().Value;
+            return (int?)debuggerBrowsableAttribute?.ConstructorArguments.Single().Value;
         }

Metadata

Metadata

Labels

Area-IDEuntriagedIssues and PRs which have not yet been triaged by a lead

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions