Skip to content

Warning reported assigning parameter marked [DisallowNull] to object #40139

@cston

Description

@cston

No warning should be reported:

#nullable enable

using System.Diagnostics.CodeAnalysis;

class C<T>
{
    object _f;

    C([DisallowNull]T t)
    {
        _f = t; // warning CS8601: Possible null reference assignment
    }
}

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions