Skip to content

Analyze local functions in NullableWalker #27233

@cston

Description

@cston
class Program
{
    static void F(object? x)
    {
        object y;
        object z;
        f();
        if (x == null) return;
        g();
        y.ToString(); // warning: y may be null
        z.ToString(); // warning?

        void f() => y = x; // warning: x may be null
        void g() => z = x; // warning?
    }
}

See LDM-2018-06-04

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions