Skip to content

Passing a value to a not nullable parameter should update state #43383

@jcouv

Description

@jcouv

LDM is discussing details of the proposal, but we agreed on core scenario:

void M(string s) { }
...
string? s = null;
M(s); // warn only here
s.ToString(); // don't warn again

This means that void M(string s) would behave like void M([NotNull] string s) behaves today.

FYI @stephentoub


The latest proposal is we can change the nullable state of a slot when either (1) we give a warning, or (2) you apply the ! operator.


Update: LDM decision below

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Language/design

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions