-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
NotNull annotations #170
Comments
I'm not a fan of those annotations myself. IMO they are not checked without tooling and thus they provide false reassurance. I'm reluctant to offer to accept a PR, as that would mean I would have to maintain the annotations going forward, and would have to ensure they are correct on all new additions. |
I mostly see them as documentation as code. As you maybe allude to they can be quite disruptive if actually incorrect (nullable marked as NotNull, opposite seems harmless) but coming from Kotlin I see the benefits of explicit nullability every day and is obviously quite a fan of it. The problem is not big though as you have been quite good at keeping null values out of the API but I would argue that the documentation is sort of missing in the places you would add the annotation. The example that triggered me to actually discover the annotations weren't present as I had assumed was methods like I understand your concern as the maintainer. Maybe others can provide more persuasive argument in the future. Kind regards |
Feel free to raise a PR to add |
I suggest to use jspecify once it is 1.0. |
I searched the issues but seems uncovered. Has it been considered to add NotNull annotations to various methods, parameters and such?
We use the library from Kotlin and having nullability explicit in the api would be really nice.
In any case, thanks for the awesome library!
The text was updated successfully, but these errors were encountered: