01/10/2017, 12:40 PM
@kirillrakhman Developer can make additional assumptions about nullability before using java code. Yep, passing arguments to java methods was a bad example - however, i think it could be useful to know, that java code possibly doesn't expect nullable, though it's not marked as
- nullability contracts in java are broken too often. When I use Kotlin and it says that arguments are ok - I'm sure nullability is ok. Can't say that about java. Often you even don't understand that you call java and that's why I want special inspection. I see two critical examples: 1. You override Java method. Today Kotlin plugin automatically makes
-arguments unless
specified, but accidental
happens causing NPE. 2. Java method returns value. Kotlin automatically infers
and allows using it as
leading to NPE. See, platform types too easy to use as
accidentally, by fault. And there is no help from lint, except
"Function or property has platform type"
that doesn't cover all platform types usages.