-
-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotate nullable reference types in public APIs #1067
Comments
The problem is that I'm still trying to support .NET Framework which doesn't have this. I'm not saying it can't be done, it's just a lot of work to #if/#else/#endif everything. |
As far as I know this should work in .net framework. You probably have to upgrade to language version 8 or higher. |
I can confirm that nullable reference types as such do work with .NET Framework. Some very useful attributes like I enabled this feature for some classes in #1068 and added I would be willing to contribute further pull request to enable nullable reference types for more classes. Enabling for the entire project would be too much work at once for me, though. |
FWIW, I created a new branch for this work. I also added compatibility attributes to reduce #if/#else's littering the codebase. I just need to find time to work on it more, haha. I wonder if I should look into writing a Roslyn-based tool to automate this. |
Is your feature request related to a problem? Please describe.
I just came across a
NullReferenceException
in my app which uses nullable reference types because I did not read MimeKit's documentation properly and missed that a type can be null.Describe the solution you'd like
I consider nullable reference types a great feature of C# that makes you as a developer think twice whether you can really omit a null check. In my opinion it would be great if MimeKit would at least add nullable attributes to its public API. It might even make sense to enable nullable reference types for the entire code base.
Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: