Skip to content

Nullability dropped in binding __refvalue #32446

@gafter

Description

@gafter

The following code fails to produce a warning, even though it dereferences a possibly-null lvalue produced through __refvalue. This is caused by us discarding the nullable annotation when binding the type in Binder.BindRefValue.

#nullable enable
using System;
public class C {
    public void M(TypedReference r) {
        _ = __refvalue(r, string?).Length;
    }
}

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