I'm currently migrating a Blazor project to .NET6 which comes with C# 10. With the new language version I'm getting a warning with the following code:
if (tmp is null)
oldValue = "";
else
oldValue = tmp.ToString();
The warning is: CS8600 "Converting null literal or possible null value to non-nullable type".
tmp
is of type object?
. That is the reason why I'm checking if it is null in the if clause.
I have noticed that many warnings of this type occur.
So what is the reason behind that? The Help page does not contain any information yet. (see here)