Skip to content

Null-checking nullable param warning should be relaxed #59226

@RikkiGibson

Description

@RikkiGibson

There are some cases where null-checking a nullable parameter is useful:

Overriding a method with a nullable parameter and rejecting null input
MicrosoftTeams-image (4)

Null-checking a nullable parameter when the postcondition guarantees non-nullability
MicrosoftTeams-image (5)

In both these scenarios, we should either avoid issuing a warning on '!!', or avoid offering the code fix which introduces '!!'.

cc @stephentoub

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions