Skip to content

Contravariant parameter types with respect to nullable reference types #30958

@sharwell

Description

@sharwell

Version Used: c9c6309

Steps to Reproduce:

abstract class A {
  public abstract void SetData(object value);
}

class B : A {
  public override void SetData(object? value) => throw null;
}

Expected Behavior:

No warning is reported.

Actual Behavior:

CS8610 is reported for B.SetData(object?).

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