Skip to content

Warn if a value is never or always null #22743

@alrz

Description

@alrz

Version Used: NullableReferenceTypes branch

Steps to Reproduce:

    public void M(string? o) {
        if (o == null) return;
        var x = o?.Length; //!
    }

Expected Behavior: warning: o is never null

Actual Behavior: no warnings

Relates to #25592

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions