Skip to content

Missing nullability warning after assignment to variable in finally block #33446

@gafter

Description

@gafter

The following should, but does not, produce a warning.

class Node
{
    public Node? Next;
    static void Mout(out Node node) => node = null!;
    static void M(Node node)
    {
        try
        {
            Mout(out node.Next);
        }
        finally
        {
            Mout(out node); // might set node to one in which node.Next == null
        }
        node.Next.ToString(); // should be warning
    }
}

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