Promote obj
to non-null when checking obj?.field == value
#4076
Labels
feature
Proposed language feature that solves one or more problems
Consider the following code:
Currently, this fails and requires to instead write:
Could we consider
obj?.field == <non-nullable expression>
to be equivalent toobj != null && obj.field == <expr>
?The text was updated successfully, but these errors were encountered: