'inline fun' extension receiver can be explicitly nullable until Kotlin 1.2
Reports inline functions with non-nullable extension receivers which don't use the fact that extension receiver is not nullable.
Before Kotlin 1.2, calls of inline fun
with flexible nullable extension receiver (a platform type with an unknown nullability) did not include nullability checks in bytecode. Since Kotlin 1.2, nullability checks are included into the bytecode (see KT-12899).
Thus functions which do not use the fact that extension receiver is not nullable are dangerous in Kotlin until 1.2 and it's recommended to make such functions to have nullable receiver.
Example:
After the quick-fix is applied:
Locating this inspection
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
RedundantNotNullExtensionReceiverOfInline- Via Settings dialog
Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.
This inspection only reports if the Kotlin language level of the project or module is lower than 1.2.
Inspection Details | |
---|---|
By default bundled with: | |
Can be installed with plugin: | Kotlin, 242.22892-IJ |