PlatformExtensionReceiverOfInline: fix false positive with extension function with nullable type receiver

#KT-37256 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-03-24 17:01:51 +09:00
committed by Yan Zhulanow
parent 6868f53f46
commit ded996bdf7
6 changed files with 29 additions and 2 deletions
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
@@ -0,0 +1,5 @@
public class JavaFoo {
public static String foo() {
return null;
}
}
@@ -0,0 +1,8 @@
inline fun String?.contentToByte(): Byte {
return 0
}
fun main() {
JavaFoo.foo().toBoolean()
JavaFoo.foo().contentToByte()
}
@@ -13,6 +13,8 @@ fun test() {
}
}
inline fun String.toBoolean(): Boolean = true
fun String.contentNotInline() {}
class My {
@@ -1,5 +1,5 @@
{
"inspectionClass": "org.jetbrains.kotlin.idea.inspections.PlatformExtensionReceiverOfInlineInspection",
"withRuntime": "true",
"isMultiModule": "false"
"isMultiModule": "true"
}