Introduce inspection for nullable extension receiver of inline function

So #KT-22303 Fixed
This commit is contained in:
Mikhail Glukhikh
2018-01-19 11:32:12 +03:00
parent 08d3f20e09
commit c90056f8c4
9 changed files with 174 additions and 1 deletions
@@ -0,0 +1,9 @@
<html>
<body>
Reports potentially unsafe calls of inline functions with flexible nullable (platform type with unknown nullability) extension receivers.
In Kotlin 1.0 or 1.1, such calls do not include nullability check in bytecode,
but in Kotlin 1.2, nullability check is included and can provoke NPE if actual receiver is null.
It's recommended to add explicit '!!' if exception is what you want,
or consider changing the function' receiver type to nullable if it should work without exceptions.
</body>
</html>