Skip to content

IDE0004 being reported on casting nint* to nint via void* #56207

@Rekkonnect

Description

@Rekkonnect

Version Used: VS 2019 Community 16.11.2

Steps to Reproduce:

In the example code below, the cast is necessary to cast a dereferenced nint* into nint:

nint** ptr = GetDoublePointer();
nint value = (nint)(void*)*ptr;

Expected Behavior: No cast redundancy warning.

Actual Behavior: IDE0004 is reported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-IDEBugIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringshelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions