Separate UNSAFE_IMPLICIT_INVOKE_CALL diagnostics introduced (see KT-8252)
This commit is contained in:
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
class Rule(val apply: () -> Unit)
|
||||
|
||||
fun foo() {
|
||||
val rule: Rule? = Rule { }
|
||||
rule?.<error descr="[UNSAFE_IMPLICIT_INVOKE_CALL] Reference has a nullable type (() -> kotlin.Unit)?, use explicit ?.invoke() to make function-like call instead">apply</error>()
|
||||
val apply = rule?.apply
|
||||
<error descr="[UNSAFE_IMPLICIT_INVOKE_CALL] Reference has a nullable type (() -> kotlin.Unit)?, use explicit ?.invoke() to make function-like call instead">apply</error>()
|
||||
}
|
||||
@@ -295,6 +295,12 @@ public class PsiCheckerTestGenerated extends AbstractPsiCheckerTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("SafeInvoke.kt")
|
||||
public void testSafeInvoke() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/SafeInvoke.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Shadowing.kt")
|
||||
public void testShadowing() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/Shadowing.kt");
|
||||
|
||||
Reference in New Issue
Block a user