Skip to content

Gray out unnecessary non-null suppression operator #26736

@sharwell

Description

@sharwell

Version Used: Nullable Reference Types Preview (7 May 2018)

Steps to Reproduce:

object? obj = new object();
var str = obj!.ToString();

Expected Behavior:

A warning is provided for the use of ! where flow analysis already determines the expression cannot be null.

Actual Behavior:

No warning is provided.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions