Skip to content

IDE0001 (Simplify type name) suggests removing Nullable<T> where behavior changes #72420

@sharwell

Description

@sharwell

Version Used:

Steps to Reproduce:

image

public void T()
{
    static void test<T>(Func<T> func)
    {
    }

    // IDE0001 expected for this call:
    test<UnmanagedCustomStruct>(() => new UnmanagedCustomStruct());

    // IDE0001 NOT expected for this call
    test<UnmanagedCustomStruct?>(() => new UnmanagedCustomStruct());
}

public struct UnmanagedCustomStruct
{
    public Guid Foo;
    public int Bar;
}

Diagnostic Id:

If this is a report about a bug in an analyzer, please include the diagnostic if possible (e.g. "IDE0030").

Expected Behavior:

No diagnostic reported.
Required generic argument is not removed.

Actual Behavior:

IDE0001 is reported, and suggests removing a generic type argument that causes a behavior change.

Metadata

Metadata

Assignees

Labels

Area-IDEBughelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

Type

No type

Projects

Status

InQueue

Relationships

None yet

Development

No branches or pull requests

Issue actions