Skip to content

No warning for mismatched nullability in constraint #27742

@cston

Description

@cston

No warning reported for new B<A<object>>():

class A<T> { }
class B<T> where T : A<object?> { }
class C
{
    static void Main()
    {
        new B<A<object?>>();
        new B<A<object>>(); // warning
    }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions