Skip to content

IDE0062 code fix (local function can be static) removes "unsafe" keyword #59286

@meziantou

Description

@meziantou

Version Used:

VS2022 17.1.0 preview 4
Compiler version: '4.1.0-3.22062.11 (cc0d213)'. Language version: 10.0

Steps to Reproduce:

  1. dotnet new console
  2. program.cs (top level program)
    A();
    unsafe void A()
    {
    }
    

image

Expected Behavior:

unsafe static void A()

Actual Behavior:

static void A()

Metadata

Metadata

Assignees

No one assigned

    Labels

    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