Open megahirt opened 1 week ago
Have you had cases where the warnings suddenly cleared like this?
I am not sure what exactly happened, but all the warnings just disappeared.
I don't think it's building. You probably didn't make any changes, so it didn't need to rebuild.
I don't think it's building. You probably didn't make any changes, so it didn't need to rebuild.
I see that is what's happening.. I was able to rebuild and see the warnings now.
It looks like you can declare things with a nullable type by adding '?' at the end of their type. eg private IEnumerable<SfmDictionary.DataShape>? _shapes;
This made the warning go away.
Or if we don't want to see all those question marks, we could use #nullable disable
directive. This works, too
I think that what we need to do in many cases is to add the question mark where it's obvious that the value is initialized to null.
See https://learn.microsoft.com/en-us/dotnet/csharp/nullable-references
There are currently 238 compiler warnings, mostly about nullable values I think, when building with a recent .Net SDK. We should fix up our code per the recommendations in the warnings.