Skip to content

Remove feature switch || runtime check() used in nuget.client repo #14944

Closed
NuGet/NuGet.Client
#7472

Description

@Nigusu-Allehu

dotnet/runtime#129296

// No warnings
if (FeatureSwitch) { Safe(); } else { Unsafe(); }

// False-positive IL2026/IL3050 on Unsafe()
if (FeatureSwitch || RuntimeCheck()) { Safe(); } else { Unsafe(); }

Instead use an expanded condtional

Activity

  1. added
    Priority:2
    on Jun 11, 2026
  2. essicajaybarron-stack commented on Jun 11, 2026

    @essicajaybarron-stack

    The first one 1️⃣ million times is the first and only one 1️⃣

  3. added this to the 7.9 milestone on Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Partner:DotNetPriority:2Type:Bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions